Przeglądaj źródła

修改查询条件

peng 2 lat temu
rodzic
commit
e1ab4896c7

+ 1 - 1
Controller/SensorGateway/SmartSocketController.py

@@ -861,7 +861,7 @@ class SmartSocketView(View):
             return response.json(444)
         # 同步数据库并下发MQTT消息到插座设备
         try:
-            socket_info_qs = SocketInfo.objects.get(serial_number=serial_number).values('status')
+            socket_info_qs = SocketInfo.objects.filter(serial_number=serial_number).values('status')
             device_info_qs = Device_Info.objects.filter(serial_number=serial_number).values('userID__region_country',
                                                                                             'NickName')
             country_qs = CountryModel.objects.filter(id=device_info_qs[0]['userID__region_country']).values(