Browse Source

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

chenjunkai 5 years ago
parent
commit
c55b4fb160
1 changed files with 7 additions and 2 deletions
  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'})