diff --git a/apps/counter/api/views.py b/apps/counter/api/views.py index ea8d2b8..adf3f26 100644 --- a/apps/counter/api/views.py +++ b/apps/counter/api/views.py @@ -45,7 +45,7 @@ class DeviceInfoListAPIView(ListAPIView): search_fields = ['device_id', 'online'] def get_queryset(self, *args, **kwargs): - queryset_list = DeviceInfo.objects.get_queryset().order_by('device_id') + queryset_list = DeviceInfo.objects.get_queryset().order_by('-online') device_id = self.request.GET.get('device_id') status = self.request.GET.get('status') if device_id: