Browse Source

优化更新异常订单接口

peng 1 year ago
parent
commit
de4c0b0dfb
2 changed files with 8 additions and 8 deletions
  1. 7 7
      Controller/SensorGateway/SmartSwitchController.py
  2. 1 1
      Controller/TestApi.py

+ 7 - 7
Controller/SensorGateway/SmartSwitchController.py

@@ -7,7 +7,7 @@
 
 from django.views import View
 
-from Model.models import SwitchInfo, SwitchDimmingSettings, SwitchChronopher
+from Model.models import SwitchInfo, SwitchDimmingSettings, SwitchChronopher, Device_Info, FamilyRoom
 from Service.CommonService import CommonService
 
 
@@ -26,15 +26,15 @@ class SmartSwitchView(View):
         token_code, user_id, response = CommonService.verify_token_get_user_id(request_dict, request)
         if token_code != 0:
             return response.json(token_code)
-        if operation == 'get-switch-info': # 设备获取智能开关数据
+        if operation == 'get-switch-info':  # 设备获取智能开关数据
             return self.get_switch_info(request_dict, response)
-        elif operation == 'get-switch-setting': # 获取智能开关调光设置
+        elif operation == 'get-switch-setting':  # 获取智能开关调光设置
             return self.get_switch_setting(request_dict, response)
-        elif operation == 'get-chronopher-setting': # 获取定时计划
+        elif operation == 'get-chronopher-setting':  # 获取定时计划
             return self.get_chronopher_setting(request_dict, response)
-        elif operation == 'add-or-edit-chronopher': # 添加/编辑定时计划
+        elif operation == 'add-or-edit-chronopher':  # 添加/编辑定时计划
             return self.add_or_edit_chronopher(request_dict, response)
-        elif operation == 'delete-chronopher': # 删除定时计划
+        elif operation == 'delete-chronopher':  # 删除定时计划
             return self.delete_chronopher(request_dict, response)
         else:
             return response.json(414)
@@ -67,7 +67,7 @@ class SmartSwitchView(View):
             return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
 
     @staticmethod
-    def get_switch_setting(request_dict, response, user_id):
+    def get_switch_setting(request_dict, response):
         """
         获取智能开关设备设置信息
         @param request_dict: 请求参数

+ 1 - 1
Controller/TestApi.py

@@ -1101,7 +1101,7 @@ class testView(View):
             is_exist = 0
             if order_qs.exists():
                 is_exist = 1
-                order_qs.update(payTime=pay_time)
+                order_qs.update(payTime=pay_time, addTime=pay_time)
             return response.json(0, {'is_exist': is_exist})
         except Exception as e:
             return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))