|
@@ -246,7 +246,7 @@ class GatewayFamilyRoomView(View):
|
|
|
if not family_room_device_qs.exists():
|
|
|
return response.json(0, [])
|
|
|
sort = FamilyRoomDevice.objects.filter(family_id=family_id).values('category').annotate(
|
|
|
- count=Count('category')).values('category', 'category_sort')
|
|
|
+ count=Count('category')).values('category', 'category_sort').order_by('category_sort')
|
|
|
for item in sort:
|
|
|
if item['category'] == 0:
|
|
|
item['category_name'] = '网关子设备类'
|
|
@@ -337,7 +337,7 @@ class GatewayFamilyRoomView(View):
|
|
|
return response.json(444)
|
|
|
try:
|
|
|
family_room_device_qs = FamilyRoomDevice.objects.filter(family_id=family_id).values('category').annotate(
|
|
|
- count=Count('category')).values('category', 'category_sort')
|
|
|
+ count=Count('category')).values('category', 'category_sort').order_by('category_sort')
|
|
|
for item in family_room_device_qs:
|
|
|
if item['category'] == 0:
|
|
|
item['category_name'] = '网关子设备类'
|