作者 lyh

gx

... ... @@ -41,8 +41,8 @@ class GoogleKeywordInsightLogic extends BaseLogic
if(!empty($data)){
//保存数据库
$detailModel = new GoogleKeywordInsightDetail();
$this->model->saveInsight($this->param['keyword'],$data);
$detailModel->saveInsightDetail($this->param['keyword'],$data);
$this->model->saveInsight($this->user['project_id'],$this->param['keyword'],$data);
$detailModel->saveInsightDetail($this->user['project_id'],$this->param['keyword'],$data);
}
}
return $this->success($data);
... ...
... ... @@ -22,10 +22,10 @@ class GoogleKeywordInsight extends Base
* @method :post
* @time :2025/3/25 14:45
*/
public function saveInsight($keyword,$data){
public function saveInsight($project_id,$keyword,$data){
$saveData = [
'search'=>$keyword,
'project_id'=>$this->user['project_id'],
'project_id'=>$project_id,
'data'=>json_encode($data,true),
];
return $this->addReturnId($saveData);
... ...
... ... @@ -23,7 +23,7 @@ class GoogleKeywordInsightDetail extends Base
* @method :post
* @time :2025/3/25 14:45
*/
public function saveInsightDetail($keyword,$data){
public function saveInsightDetail($project_id,$keyword,$data){
$saveData = [];
foreach ($data as $val){
$zh_text = Translate::tran($val['text'], 'zh');
... ... @@ -34,7 +34,7 @@ class GoogleKeywordInsightDetail extends Base
'search'=>$keyword,
'text'=>$val['text'],
'zh_text'=>$zh_text,
'project_id'=>$this->user['project_id'],
'project_id'=>$project_id,
'volume'=>$val['volume'],
'competition_level'=>$val['competition_level'],
'competition_index'=>$val['competition_index'],
... ...
... ... @@ -55,19 +55,6 @@ class Keyword extends Base
];
/**
* 聚合页按照首字母归类
* @param $string
* @return int
*/
public function getFirstWord($string) {
$first_string = strtolower(mb_substr($string, 0, 1));
if (is_numeric($first_string))
return 0;
$string_key = array_search($first_string, $this->firstNumWord);
return $string_key ?: 27;
}
/**
* @remark :视频
* @name :getKeywordVideoAttribute
* @author :lyh
... ... @@ -156,7 +143,7 @@ class Keyword extends Base
}
/**
* @remark :保存到产品关键词中
* @remark :批量保存到产品关键词中
* @name :saveBKeyword
* @author :lyh
* @method :post
... ...