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