diff --git a/app/api/controller/Statistics.php b/app/api/controller/Statistics.php index 72026c0..0a6c6c7 100644 --- a/app/api/controller/Statistics.php +++ b/app/api/controller/Statistics.php @@ -1232,7 +1232,7 @@ class Statistics extends BaseController } //获取天气 - public function get_weather(){ + public function get_weather($street_id=0){ // 获取天气 // 101271007 纳溪 510503 // 101271002 江阳区 510502 @@ -1243,6 +1243,9 @@ class Statistics extends BaseController // 101271005 叙永 510524 // 判断区域 $name = '101271002'; + if ($street_id){ + $name = $street_id; + } $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;