Quellcode durchsuchen

增加天气接口使用cityid查询

yf_yzl vor 2 Jahren
Ursprung
Commit
aafe9d4600
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      apps/apply_weather.py

+ 2 - 0
apps/apply_weather.py

@@ -70,6 +70,7 @@ class GetWeather(APIView):
             table = "day_data" if day_type == "1" else "serven_day_data"
             table = "day_data" if day_type == "1" else "server_day_data"
             if cityid:
+                logging.warning(f"{cityid}: 使用cityid查询")
                 sql = f"select content from {table} where cityid = '{cityid}'"
                 cursor.execute(sql)
                 result = cursor.fetchone()
@@ -80,6 +81,7 @@ class GetWeather(APIView):
                 else:
                     return Response({"msg": "请联系管理员排查", "code": 500})
             else:
+                logging.warning("使用province,city,distinct查询")
                 sql = f"select content from {table} where province = '{province}' and city ='{city}' and district ='{district}'"
                 cursor.execute(sql)
                 result = cursor.fetchone()