|
...
|
...
|
@@ -51,21 +51,18 @@ 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']);
|
|
|
|
if($info === false){
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
$main_keyword = explode("\r\n", $info[$this->param['field']]);
|
|
|
|
$main_keyword = explode("\r\n", $info['main_keyword']);
|
|
|
|
$customer_keywords = explode("\r\n", $info['customer_keywords']);
|
|
|
|
$array = array_merge($main_keyword, $customer_keywords);
|
|
|
|
$detailModel = new GoogleKeywordInsightDetail();
|
|
|
|
$resultData = [];
|
|
|
|
if(!empty($main_keyword)){
|
|
|
|
$resultData = $this->paginateArray($main_keyword,$this->page,$this->row);
|
|
|
|
if(!empty($array)){
|
|
|
|
$resultData = $this->paginateArray($array,$this->page,$this->row);
|
|
|
|
$detailList = $detailModel->read(['search'=>['in',$resultData['list']]]);
|
|
|
|
foreach ($resultData['list'] as $key => $item){
|
|
|
|
$result['keyword'] = $item;
|
...
|
...
|
|