Explorar o código

Merge remote-tracking branch 'remotes/origin/ming' into test

Ansjer %!s(int64=3) %!d(string=hai) anos
pai
achega
52f96e4eef
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      Controller/UnicomCombo/UnicomComboController.py

+ 6 - 2
Controller/UnicomCombo/UnicomComboController.py

@@ -18,7 +18,7 @@ from django.http import HttpResponse, JsonResponse
 from django.views.generic.base import View
 
 from Model.models import UnicomDeviceInfo, UnicomCombo, Pay_Type, Order_Model, Store_Meal, AiStoreMeal, \
-    UnicomComboOrderInfo, UnicomComboExperienceHistory, UnicomDeviceStatusChangePush
+    UnicomComboOrderInfo, UnicomComboExperienceHistory, UnicomDeviceStatusChangePush, SysMsgModel
 from Object.ResponseObject import ResponseObject
 from Object.TokenObject import TokenObject
 from Object.UnicomObject import UnicomObjeect
@@ -219,13 +219,17 @@ class UnicomComboView(View):
             with transaction.atomic():
                 device_info_qs = UnicomDeviceInfo.objects.filter(iccid=iccid, serial_no=serial_no)
                 if device_info_qs.exists():
-                    device_info_qs.update(status=1, updated_time=now_time)
+                    sys_msg_qs = SysMsgModel.objects.filter(uid=serial_no)
+                    if sys_msg_qs.exists():
+                        sys_msg_qs.delete()
+                    device_info_qs.update(status=1, updated_time=now_time, user_id='')
                     combo_order_qs = UnicomComboOrderInfo.objects.filter(iccid=iccid)
                     if combo_order_qs.exists():
                         combo_order_qs.delete()
                     combo_experience_history_qs = UnicomComboExperienceHistory.objects.filter(iccid=iccid)
                     if combo_experience_history_qs.exists():
                         combo_experience_history_qs.delete()
+
                 return response.json(0)
         except Exception as e:
             print(e.args)