作者 lyh

gx

... ... @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\GoogleKeywordInsight;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\GoogleKeywordInsight\GoogleKeywordInsightLogic;
use App\Models\GoogleKeywordInsight\GoogleKeywordInsightDetail;
/**
* @remark :谷歌洞察数据
... ... @@ -35,7 +36,9 @@ class GoogleKeywordInsightController extends BaseController
],[
'keyword.required' => '关键词不能为空',
]);
$data = $logic->getGoogleInsight();
$logic->getGoogleInsight();
$detailModel = new GoogleKeywordInsightDetail();
$data = $detailModel->lists(['search'=>$this->param['keyword']],$this->page,$this->row);
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -35,7 +35,7 @@ class GoogleKeywordInsightLogic extends BaseLogic
* @time :2025/3/25 14:36
*/
public function getGoogleInsight(){
$data = $this->model->read(['search'=>$this->param['keyword']]);
$data = $this->model->read(['search'=>$this->param['keyword']],['id']);
if($data === false){
$this->service = new GoogleSearchService();
$data = $this->service->requestUrl($this->param['keyword']);
... ... @@ -52,10 +52,7 @@ class GoogleKeywordInsightLogic extends BaseLogic
$this->fail('保存失败,请联系管理员');
}
}
}else{
$googleDetailModel = new GoogleKeywordInsightDetail();
$data = $googleDetailModel->list(['search'=>$this->param['keyword']]);
}
return $this->success($data);
return $this->success();
}
}
... ...