Browse Source

修复代理用户设备关系bug

linhaohong 1 year ago
parent
commit
7b7a275f35
1 changed files with 4 additions and 1 deletions
  1. 4 1
      AdminController/CloudServiceManage/AgentDeviceController.py

+ 4 - 1
AdminController/CloudServiceManage/AgentDeviceController.py

@@ -26,6 +26,7 @@ from Model.models import DeviceTypeModel
 
 from Object.ResponseObject import ResponseObject
 from Ansjer.config import LOGGER
+from Object.TokenObject import TokenObject
 
 
 class AgentDeviceView(View):
@@ -71,6 +72,8 @@ class AgentDeviceView(View):
                 return self.get_agent_device(userID, request_dict, response)
             elif operation == 'getAgentDeviceOrder':
                 return self.get_agent_device_order(userID, request_dict, response)
+            elif operation == 'batchBandDevice':
+                return self.batch_band_device(userID, request, request_dict, response)
             else:
                 return response.json(444, 'operation')
 
@@ -100,7 +103,7 @@ class AgentDeviceView(View):
         ac_id = agent_customer_info.id
 
         try:
-            agent_device_qs = AgentDevice.objects.filter(ac_id=ac_id)
+            agent_device_qs = AgentDevice.objects.filter(ac_id=ac_id).order_by('ac_id', '-created_time')
 
             if device_name:
                 # 根据device_name查询对应的type值