瀏覽代碼

更新SIM查询

林轩 1 周之前
父節點
當前提交
3056f8f481
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      apps/IOTCard/views.py

+ 1 - 1
apps/IOTCard/views.py

@@ -171,7 +171,7 @@ class PlatformIOTCardViewSet(viewsets.ModelViewSet):
 
     @action(methods=['get'], detail=False, url_path='get_device_type', url_name='get_device_type')
     def get_device_type(self, request, *args, **kwargs):
-        queryset = PlatSimInfo.objects.raw("SELECT device_type FROM plat_sim_info GROUP BY device_type;")
+        queryset = PlatSimInfo.objects.raw("SELECT any_value(id), device_type FROM plat_sim_info GROUP BY device_type;")
         data = []
         for i in queryset:
             data.append(i.device_type)