接口修改8

This commit is contained in:
彭桃 2023-02-14 14:21:44 +08:00
parent 214d04dca4
commit 002e9ba8a1

View File

@ -1232,7 +1232,7 @@ class Statistics extends BaseController
} }
//获取天气 //获取天气
public function get_weather(){ public function get_weather($street_id=0){
// 获取天气 // 获取天气
// 101271007 纳溪 510503 // 101271007 纳溪 510503
// 101271002 江阳区 510502 // 101271002 江阳区 510502
@ -1243,6 +1243,9 @@ class Statistics extends BaseController
// 101271005 叙永 510524 // 101271005 叙永 510524
// 判断区域 // 判断区域
$name = '101271002'; $name = '101271002';
if ($street_id){
$name = $street_id;
}
$url = "https://devapi.qweather.com/v7/weather/now?key=b3e94fa75aae4551b6a5db150b409261&location=".$name; $url = "https://devapi.qweather.com/v7/weather/now?key=b3e94fa75aae4551b6a5db150b409261&location=".$name;
$url1 = "https://devapi.qweather.com/v7/indices/1d?key=b3e94fa75aae4551b6a5db150b409261&type=0&location=".$name; $url1 = "https://devapi.qweather.com/v7/indices/1d?key=b3e94fa75aae4551b6a5db150b409261&type=0&location=".$name;