wzh 5 年之前
父节点
当前提交
5a9de32cdf
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      api/application/controllers/Project.php

+ 1 - 1
api/application/controllers/Project.php

@@ -133,7 +133,7 @@ class Project extends Base_Controller {
                 $resData = request_post($url);
                 $arr = json_decode($resData,true);
                 if ($arr['code'] == 10000) {
-                    if ($arr['result']['HeWeather5'][0]['status'] == 'unknown location') {
+                    if ($arr['result']['HeWeather5'][0]['status'] == 'unknown location' || $arr['result']['HeWeather5'][0]['status'] != 'ok') {
                         $url = 'https://free-api.heweather.net/s6/weather/forecast?location='.$res1['longitude'].','.$res1['latitude'].'&key=63dbc994630941fab269ad3c3af4d5d2';
                         // $url = 'https://way.jd.com/he/freeweather?city='.$res2['chinese_name'].'&appkey=a44fc7f907194098c69bb8e90003bca6';
                         $resData = request_post($url);