作者 lyh

gx

@@ -37,13 +37,16 @@ class GoogleSearchController extends BaseController @@ -37,13 +37,16 @@ class GoogleSearchController extends BaseController
37 $searchDetailModel = new GoogleSearchDetail(); 37 $searchDetailModel = new GoogleSearchDetail();
38 $this->map['project_id']= $this->user['project_id']; 38 $this->map['project_id']= $this->user['project_id'];
39 $data = $searchDetailModel->lists($this->map,$this->page,$this->row); 39 $data = $searchDetailModel->lists($this->map,$this->page,$this->row);
40 -  
41 if($this->param['type'] == 'country'){ 40 if($this->param['type'] == 'country'){
42 $country = []; 41 $country = [];
43 - foreach ($data as $key => $val){ 42 + foreach ($data as $val){
44 $country[] = Country::getCountryNameByAlpha3($val['keys']); 43 $country[] = Country::getCountryNameByAlpha3($val['keys']);
45 } 44 }
46 - $route = Translate::tran($country, 'en'); 45 + $zh_country = Translate::tran($country, 'zh');
  46 + foreach ($data as $key => $val){
  47 + $val['zh_country'] = $zh_country[$key];
  48 + $data[$key] = $val;
  49 + }
47 } 50 }
48 $this->response('success',Code::SUCCESS,$data); 51 $this->response('success',Code::SUCCESS,$data);
49 } 52 }