作者 lyh

gx

... ... @@ -51,14 +51,17 @@ class GoogleKeywordInsightController extends BaseController
* @time :2025/4/1 9:12
*/
public function getOptimizeList(){
$this->request->validate([
'field' => 'required'
],[
'field.required' => 'field不能为空',
]);
$projectKeywordModel = new ProjectKeyword();
$info = $projectKeywordModel->read(['project_id'=>$this->user['project_id']],['main_keyword','customer_keywords']);
$info = $projectKeywordModel->read(['project_id'=>$this->user['project_id']],[$this->param['filed']]);
if($info === false){
$this->response('success');
}
$main_keyword = explode("\r\n", $info['main_keyword']);
$customer_keywords = explode("\r\n", $info['customer_keywords']);
$array = array_merge($main_keyword, $customer_keywords);
$array = explode("\r\n", $info[$this->param['filed']]);
$detailModel = new GoogleKeywordInsightDetail();
$resultData = [];
if(!empty($array)){
... ...
... ... @@ -10,6 +10,8 @@
namespace App\Http\Controllers\Bside\GoogleKeyword;
use App\Enums\Common\Code;
use App\Helper\Country;
use App\Helper\Translate;
use App\Http\Controllers\Bside\BaseController;
use App\Models\Com\NoticeLog;
use App\Models\GoogleSearch\GoogleSearch;
... ... @@ -35,6 +37,14 @@ 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 $key => $val){
$country[] = Country::getCountryNameByAlpha3($val['keys']);
}
$route = Translate::tran($country, 'en');
}
$this->response('success',Code::SUCCESS,$data);
}
}
... ...