作者 lyh

gx

@@ -78,9 +78,10 @@ class GoogleSearchService @@ -78,9 +78,10 @@ class GoogleSearchService
78 $this->url = 'https://www.cmer.site/api/google/search'; 78 $this->url = 'https://www.cmer.site/api/google/search';
79 $url = $this->url.'?domain='.$domain.'&q='.$data[$search]; 79 $url = $this->url.'?domain='.$domain.'&q='.$data[$search];
80 $data = http_get($url); 80 $data = http_get($url);
  81 + $data = $data['data'] ?? [];
81 if(!empty($data) && ($search == 5)){ 82 if(!empty($data) && ($search == 5)){
82 foreach ($data as $key => $val){ 83 foreach ($data as $key => $val){
83 - $val['keys_country'] = Country::getCountryNameByAlpha3($val['keys'][0]); 84 + $val['keys_country'] = Country::getCountryNameByAlpha3(strtoupper($val['keys'][0]));
84 $data[$key] = $val; 85 $data[$key] = $val;
85 } 86 }
86 } 87 }