Преглед изворни кода

Merge branch 'dev' of ssh://192.168.136.45:10022/SERVER/AnsjerServer into dev

chenjunkai пре 5 година
родитељ
комит
c55b4fb160
1 измењених фајлова са 7 додато и 2 уклоњено
  1. 7 2
      Controller/EquipmentInfo.py

+ 7 - 2
Controller/EquipmentInfo.py

@@ -150,10 +150,15 @@ class EquipmentInfo(View):
 
     def update_info(self, request_dict, userID, response):
         id_all = request_dict.getlist('all', None)
+        type = request_dict.getlist('eventType', None)
         if id_all == 1:
             try:
-                eq = Equipment_Info.objects.filter(userID=userID)
-                eq.update(status=1)
+                if Type == 57:
+                    eq = Equipment_Info.objects.filter(userID=userID, eventType=type)
+                    eq.update(status=1)
+                else:
+                    eq = Equipment_Info.objects.filter(userID=userID)
+                    eq.update(status=1)
             except Exception as e:
                 print(repr(e))
             return response.json(0, {'update_success': 'all'})