作者 lyh

gx

... ... @@ -980,7 +980,7 @@ class Country
* @method :post
* @time :2025/3/27 10:38
*/
public function getCountryNameByAlpha3($alpha3) {
public static function getCountryNameByAlpha3($alpha3) {
// ISO 3166-1 alpha-3 国家码与国家名称的映射
$countries = [
'AFG' => 'Afghanistan',
... ...
... ... @@ -9,6 +9,8 @@
namespace App\Services;
use App\Helper\Country;
/**
* @remark :google关键字扩展
* @name :GoogleSearchService
... ... @@ -75,7 +77,14 @@ class GoogleSearchService
];
$this->url = 'https://www.cmer.site/api/google/search';
$url = $this->url.'?domain='.$domain.'&q='.$data[$search];
return http_get($url);
$data = http_get($url);
if(!empty($data) && ($search == 5)){
foreach ($data as $key => $val){
$val['keys_country'] = Country::getCountryNameByAlpha3($val['keys'][0]);
$data[$key] = $val;
}
}
return $data;
}
}
... ...