作者 lyh

gx

... ... @@ -37,15 +37,17 @@ class GoogleSearchController extends BaseController
$searchDetailModel = new GoogleSearchDetail();
$this->map['project_id']= $this->user['project_id'];
$data = $searchDetailModel->lists($this->map,$this->page,$this->row);
if($this->param['type'] == 'country'){
$country = [];
foreach ($data as $val){
$country[] = Country::getCountryNameByAlpha3($val['keys']);
}
$zh_country = Translate::tran($country, 'zh');
foreach ($data as $key => $val){
$val['zh_country'] = $zh_country[$key];
$data[$key] = $val;
if(!empty($data)){
if($this->param['type'] == 'country'){
$country = [];
foreach ($data as $val){
$country[] = Country::getCountryNameByAlpha3($val['keys']);
}
$zh_country = Translate::tran($country, 'zh');
foreach ($data as $key => $val){
$val['zh_country'] = $zh_country[$key];
$data[$key] = $val;
}
}
}
$this->response('success',Code::SUCCESS,$data);
... ...