Explorar el Código

优化卡用户筛查(更新时间和排序)

guanhailong hace 2 años
padre
commit
79ec064ba3
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      AdminController/UnicomManageController.py

+ 2 - 1
AdminController/UnicomManageController.py

@@ -76,7 +76,7 @@ class UnicomManageControllerView(View):
         line = int(pageSize)
 
         try:
-            unicom_device_qs = UnicomDeviceInfo.objects.all()
+            unicom_device_qs = UnicomDeviceInfo.objects.all().order_by('-updated_time')
             device_user_qs = Device_User.objects.filter().values(
                 'userID', 'NickName', 'phone')
             if iccid:
@@ -106,6 +106,7 @@ class UnicomManageControllerView(View):
                     'cardType': unicom_device.card_type,
                     'mainCard': unicom_device.main_card,
                     'createdTime': unicom_device.created_time,
+                    'updatedTime': unicom_device.updated_time
                 }
                 device_user_qs = Device_User.objects.filter(userID=unicom_device.user_id).values('NickName', 'phone')
                 data['NickName'] = device_user_qs[0]['NickName'] if device_user_qs.first() else ''