Explorar o código

设备控制更新

yf_yzl %!s(int64=2) %!d(string=hai) anos
pai
achega
4be171a061
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      smartfarming/api/views/forecast/worm_lamp.py

+ 4 - 0
smartfarming/api/views/forecast/worm_lamp.py

@@ -1969,6 +1969,10 @@ def xycb_pest_chart(request):
                 "pest_num": infr_ct,
                 "addtime": addtime
             })
+            try:
+                infr_ct = int(infr_ct)
+            except Exception as e:
+                infr_ct = 0
             total_pest_num += infr_ct
         except Exception as e:
             logger.error(f"Json 解析错误:{e}")