Переглянути джерело

更新推送消息全部已读不生效问题

zhangdongming 3 роки тому
батько
коміт
518a79d9d2
1 змінених файлів з 3 додано та 2 видалено
  1. 3 2
      Controller/EquipmentInfo.py

+ 3 - 2
Controller/EquipmentInfo.py

@@ -150,13 +150,14 @@ class EquipmentInfo(View):
         eventType = request_dict.get('eventType', None)
         if int(is_update_all) == 1:
             try:
+                is_update = 0
                 for i in range(1, 8):
                     eq_qs = EquipmentInfoService.get_equipment_info_model('', i)
                     eq_qs = eq_qs.filter(device_user_id=userID)
                     if eventType:
                         eq_qs = eq_qs.filter(event_type=int(eventType))
-                    is_update = eq_qs.update(status=1)
-                    return response.json(0, {'update_count': is_update})
+                    is_update += eq_qs.update(status=1)
+                return response.json(0, {'update_count': is_update})
             except Exception as e:
                 print(repr(e))
             return response.json(0, {'update_success': 'all'})