|
@@ -21,6 +21,8 @@ class Keyword extends Base |
|
@@ -21,6 +21,8 @@ class Keyword extends Base |
|
21
|
//连接数据库
|
21
|
//连接数据库
|
|
22
|
protected $connection = 'custom_mysql';
|
22
|
protected $connection = 'custom_mysql';
|
|
23
|
|
23
|
|
|
|
|
24
|
+ const TYPE_ORDER_KEYWORD = 1;//关键词标识,预约关键词标识
|
|
|
|
25
|
+
|
|
24
|
const STATUS_ACTIVE = 1;
|
26
|
const STATUS_ACTIVE = 1;
|
|
25
|
//获取字母对应数字
|
27
|
//获取字母对应数字
|
|
26
|
public $firstNumWord = [
|
28
|
public $firstNumWord = [
|
|
@@ -110,7 +112,7 @@ class Keyword extends Base |
|
@@ -110,7 +112,7 @@ class Keyword extends Base |
|
110
|
public static function extendKeyword($project_id)
|
112
|
public static function extendKeyword($project_id)
|
|
111
|
{
|
113
|
{
|
|
112
|
$result = [];
|
114
|
$result = [];
|
|
113
|
- $keywords = self::where(['project_id' => $project_id])->pluck('seo_title', 'title')->toArray();
|
115
|
+ $keywords = self::where(['project_id' => $project_id])->where('type',self::TYPE_ORDER_KEYWORD)->pluck('seo_title', 'title')->toArray();
|
|
114
|
if (empty($keywords))
|
116
|
if (empty($keywords))
|
|
115
|
return $result;
|
117
|
return $result;
|
|
116
|
// $item:前缀 + 关键词 + 后缀
|
118
|
// $item:前缀 + 关键词 + 后缀
|
|
@@ -149,7 +151,7 @@ class Keyword extends Base |
|
@@ -149,7 +151,7 @@ class Keyword extends Base |
|
149
|
* @method :post
|
151
|
* @method :post
|
|
150
|
* @time :2025/3/25 16:28
|
152
|
* @time :2025/3/25 16:28
|
|
151
|
*/
|
153
|
*/
|
|
152
|
- public function saveBKeyword($project_id,$keywords){
|
154
|
+ public function saveBKeyword($project_id,$keywords,$type = 0){
|
|
153
|
foreach ($keywords as $v){
|
155
|
foreach ($keywords as $v){
|
|
154
|
if(empty($v)){
|
156
|
if(empty($v)){
|
|
155
|
continue;
|
157
|
continue;
|
|
@@ -159,6 +161,7 @@ class Keyword extends Base |
|
@@ -159,6 +161,7 @@ class Keyword extends Base |
|
159
|
$param['project_id'] = $project_id;
|
161
|
$param['project_id'] = $project_id;
|
|
160
|
$param['title'] = $v;
|
162
|
$param['title'] = $v;
|
|
161
|
$param['first_word'] = $this->first_word($param['title']);
|
163
|
$param['first_word'] = $this->first_word($param['title']);
|
|
|
|
164
|
+ $param['type'] = $type;
|
|
162
|
$this->addReturnId($param);
|
165
|
$this->addReturnId($param);
|
|
163
|
}
|
166
|
}
|
|
164
|
}
|
167
|
}
|