Selaa lähdekoodia

重置消息提醒_3

locky 4 vuotta sitten
vanhempi
commit
ee0e5317ed
1 muutettua tiedostoa jossa 3 lisäystä ja 6 poistoa
  1. 3 6
      Controller/ShadowController.py

+ 3 - 6
Controller/ShadowController.py

@@ -84,10 +84,6 @@ def update_device_shadow(request):
             uid_channel_qs.update(voice_prompt_intelligent_mute=0, voice_prompt_status=0, voice_prompt_enter=0,
                            voice_prompt_leave=0)
 
-        # 重置消息提醒
-        device_info_qs = Device_Info.objects.filter(UID=uid)
-        device_info_qs.update(NotificationMode=0)
-
         # 删除uid_set数据
         UidSetModel.objects.filter(uid=uid).delete()
 
@@ -95,7 +91,7 @@ def update_device_shadow(request):
         uid_bucket = UID_Bucket.objects.filter(uid=uid, endTime__gte=nowTime).values('id', 'has_unused').order_by(
             'addTime')
         if not uid_bucket.exists():
-            device_info_qs.update(isExist=2)
+            Device_Info.objects.filter(UID=uid).update(isExist=2)
         # 删除预览图
         uid_pre_qs = UID_Preview.objects.filter(uid=uid)
         if uid_pre_qs.exists():
@@ -143,7 +139,8 @@ def update_device_shadow(request):
     if cloud_vod:
         qs_dict['cloud_vod'] = cloud_vod
     if push_status:
-        qs_dict['detect_status'] = push_status
+        # 复位重置推送消息提醒
+        qs_dict['detect_status'] = 0 if is_reset == '1' else push_status
     if pwd:
         qs_dict['pwd'] = pwd
     if is_human: