正在显示
4 个修改的文件
包含
7 行增加
和
20 行删除
| @@ -41,8 +41,8 @@ class GoogleKeywordInsightLogic extends BaseLogic | @@ -41,8 +41,8 @@ class GoogleKeywordInsightLogic extends BaseLogic | ||
| 41 | if(!empty($data)){ | 41 | if(!empty($data)){ |
| 42 | //保存数据库 | 42 | //保存数据库 |
| 43 | $detailModel = new GoogleKeywordInsightDetail(); | 43 | $detailModel = new GoogleKeywordInsightDetail(); |
| 44 | - $this->model->saveInsight($this->param['keyword'],$data); | ||
| 45 | - $detailModel->saveInsightDetail($this->param['keyword'],$data); | 44 | + $this->model->saveInsight($this->user['project_id'],$this->param['keyword'],$data); |
| 45 | + $detailModel->saveInsightDetail($this->user['project_id'],$this->param['keyword'],$data); | ||
| 46 | } | 46 | } |
| 47 | } | 47 | } |
| 48 | return $this->success($data); | 48 | return $this->success($data); |
| @@ -22,10 +22,10 @@ class GoogleKeywordInsight extends Base | @@ -22,10 +22,10 @@ class GoogleKeywordInsight extends Base | ||
| 22 | * @method :post | 22 | * @method :post |
| 23 | * @time :2025/3/25 14:45 | 23 | * @time :2025/3/25 14:45 |
| 24 | */ | 24 | */ |
| 25 | - public function saveInsight($keyword,$data){ | 25 | + public function saveInsight($project_id,$keyword,$data){ |
| 26 | $saveData = [ | 26 | $saveData = [ |
| 27 | 'search'=>$keyword, | 27 | 'search'=>$keyword, |
| 28 | - 'project_id'=>$this->user['project_id'], | 28 | + 'project_id'=>$project_id, |
| 29 | 'data'=>json_encode($data,true), | 29 | 'data'=>json_encode($data,true), |
| 30 | ]; | 30 | ]; |
| 31 | return $this->addReturnId($saveData); | 31 | return $this->addReturnId($saveData); |
| @@ -23,7 +23,7 @@ class GoogleKeywordInsightDetail extends Base | @@ -23,7 +23,7 @@ class GoogleKeywordInsightDetail extends Base | ||
| 23 | * @method :post | 23 | * @method :post |
| 24 | * @time :2025/3/25 14:45 | 24 | * @time :2025/3/25 14:45 |
| 25 | */ | 25 | */ |
| 26 | - public function saveInsightDetail($keyword,$data){ | 26 | + public function saveInsightDetail($project_id,$keyword,$data){ |
| 27 | $saveData = []; | 27 | $saveData = []; |
| 28 | foreach ($data as $val){ | 28 | foreach ($data as $val){ |
| 29 | $zh_text = Translate::tran($val['text'], 'zh'); | 29 | $zh_text = Translate::tran($val['text'], 'zh'); |
| @@ -34,7 +34,7 @@ class GoogleKeywordInsightDetail extends Base | @@ -34,7 +34,7 @@ class GoogleKeywordInsightDetail extends Base | ||
| 34 | 'search'=>$keyword, | 34 | 'search'=>$keyword, |
| 35 | 'text'=>$val['text'], | 35 | 'text'=>$val['text'], |
| 36 | 'zh_text'=>$zh_text, | 36 | 'zh_text'=>$zh_text, |
| 37 | - 'project_id'=>$this->user['project_id'], | 37 | + 'project_id'=>$project_id, |
| 38 | 'volume'=>$val['volume'], | 38 | 'volume'=>$val['volume'], |
| 39 | 'competition_level'=>$val['competition_level'], | 39 | 'competition_level'=>$val['competition_level'], |
| 40 | 'competition_index'=>$val['competition_index'], | 40 | 'competition_index'=>$val['competition_index'], |
| @@ -55,19 +55,6 @@ class Keyword extends Base | @@ -55,19 +55,6 @@ class Keyword extends Base | ||
| 55 | ]; | 55 | ]; |
| 56 | 56 | ||
| 57 | /** | 57 | /** |
| 58 | - * 聚合页按照首字母归类 | ||
| 59 | - * @param $string | ||
| 60 | - * @return int | ||
| 61 | - */ | ||
| 62 | - public function getFirstWord($string) { | ||
| 63 | - $first_string = strtolower(mb_substr($string, 0, 1)); | ||
| 64 | - if (is_numeric($first_string)) | ||
| 65 | - return 0; | ||
| 66 | - $string_key = array_search($first_string, $this->firstNumWord); | ||
| 67 | - return $string_key ?: 27; | ||
| 68 | - } | ||
| 69 | - | ||
| 70 | - /** | ||
| 71 | * @remark :视频 | 58 | * @remark :视频 |
| 72 | * @name :getKeywordVideoAttribute | 59 | * @name :getKeywordVideoAttribute |
| 73 | * @author :lyh | 60 | * @author :lyh |
| @@ -156,7 +143,7 @@ class Keyword extends Base | @@ -156,7 +143,7 @@ class Keyword extends Base | ||
| 156 | } | 143 | } |
| 157 | 144 | ||
| 158 | /** | 145 | /** |
| 159 | - * @remark :保存到产品关键词中 | 146 | + * @remark :批量保存到产品关键词中 |
| 160 | * @name :saveBKeyword | 147 | * @name :saveBKeyword |
| 161 | * @author :lyh | 148 | * @author :lyh |
| 162 | * @method :post | 149 | * @method :post |
-
请 注册 或 登录 后发表评论