|
|
@@ -26,6 +26,12 @@ def querysn(request):
|
26
|
26
|
try:
|
27
|
27
|
log = ConsumeInfoSubmitLogInfo.objects.get(brand_id=brand_id, model_id=model_id, serialNo=sn, submit_during_activity=True, has_used=False)
|
28
|
28
|
except ConsumeInfoSubmitLogInfo.DoesNotExist:
|
|
29
|
+ log = None
|
|
30
|
+
|
|
31
|
+ if not log:
|
|
32
|
+ log = ConsumeInfoSubmitLogInfo.objects.filter(brand_id=brand_id, model_id=model_id, serialNo=sn).order_by('dupload').first()
|
|
33
|
+
|
|
34
|
+ if not log:
|
29
|
35
|
return response(ProductMachineStatusCode.SN_NOT_FOUND)
|
30
|
36
|
|
31
|
37
|
return response(200, 'Query SN Success', u'查询序列号成功', data=log.data)
|
|
|
@@ -42,7 +48,7 @@ def usecoupon(request):
|
42
|
48
|
return response(ProductBrandStatusCode.BRAND_NOT_MATCH)
|
43
|
49
|
|
44
|
50
|
try:
|
45
|
|
- log = ConsumeInfoSubmitLogInfo.objects.get(brand_id=brand_id, model_id=model_id, serialNo=sn)
|
|
51
|
+ log = ConsumeInfoSubmitLogInfo.objects.get(brand_id=brand_id, model_id=model_id, serialNo=sn, submit_during_activity=True, has_used=False)
|
46
|
52
|
except ConsumeInfoSubmitLogInfo.DoesNotExist:
|
47
|
53
|
return response(ProductMachineStatusCode.SN_NOT_FOUND)
|
48
|
54
|
|