|
@@ -12,6 +12,7 @@ use App\Models\Domain\DomainInfo; |
|
@@ -12,6 +12,7 @@ use App\Models\Domain\DomainInfo; |
|
12
|
use App\Models\Mail\Mail;
|
12
|
use App\Models\Mail\Mail;
|
|
13
|
use App\Models\Project\DeployBuild;
|
13
|
use App\Models\Project\DeployBuild;
|
|
14
|
use App\Models\Project\DeployOptimize;
|
14
|
use App\Models\Project\DeployOptimize;
|
|
|
|
15
|
+use App\Models\Project\Project;
|
|
15
|
use App\Models\Project\ProjectKeyword;
|
16
|
use App\Models\Project\ProjectKeyword;
|
|
16
|
use App\Models\Project\ProjectUpdateTdk;
|
17
|
use App\Models\Project\ProjectUpdateTdk;
|
|
17
|
use App\Models\User\User;
|
18
|
use App\Models\User\User;
|
|
@@ -263,6 +264,7 @@ class UpdateSeoTdk extends Command |
|
@@ -263,6 +264,7 @@ class UpdateSeoTdk extends Command |
|
263
|
public function seo_tdk($project_id, $task_id)
|
264
|
public function seo_tdk($project_id, $task_id)
|
|
264
|
{
|
265
|
{
|
|
265
|
$notify_master = $notify_keyword = false;
|
266
|
$notify_master = $notify_keyword = false;
|
|
|
|
267
|
+ $project = Project::find($project_id);
|
|
266
|
//更新统计
|
268
|
//更新统计
|
|
267
|
$update = [];
|
269
|
$update = [];
|
|
268
|
//AI指令 是否有定制指令
|
270
|
//AI指令 是否有定制指令
|
|
@@ -366,12 +368,21 @@ class UpdateSeoTdk extends Command |
|
@@ -366,12 +368,21 @@ class UpdateSeoTdk extends Command |
|
366
|
}
|
368
|
}
|
|
367
|
} else if ($table == 'gl_product_keyword' && $field == 'seo_title') {
|
369
|
} else if ($table == 'gl_product_keyword' && $field == 'seo_title') {
|
|
368
|
# TODO 聚合页seo title 特殊处理 前缀_1 . 关键词 . 后缀_2
|
370
|
# TODO 聚合页seo title 特殊处理 前缀_1 . 关键词 . 后缀_2
|
|
|
|
371
|
+ $seo_title = '';
|
|
|
|
372
|
+ //只有推广项目才加 前后缀
|
|
|
|
373
|
+ if($project->type == Project::TYPE_TWO) {
|
|
|
|
374
|
+ $prefix = $this->getPrefixKeyword($project_id, 'prefix', 1);
|
|
|
|
375
|
+ $suffix = $this->getPrefixKeyword($project_id, 'suffix', 2);
|
|
|
|
376
|
+ if (empty($prefix) || empty($suffix)) {
|
|
|
|
377
|
+ continue;
|
|
|
|
378
|
+ }
|
|
|
|
379
|
+
|
|
369
|
$prefix = $this->getPrefixKeyword($project_id, 'prefix', 1, $v[$this->topic_fields[$table]]);
|
380
|
$prefix = $this->getPrefixKeyword($project_id, 'prefix', 1, $v[$this->topic_fields[$table]]);
|
|
370
|
$suffix = $this->getPrefixKeyword($project_id, 'suffix', 2, $v[$this->topic_fields[$table]]);
|
381
|
$suffix = $this->getPrefixKeyword($project_id, 'suffix', 2, $v[$this->topic_fields[$table]]);
|
|
371
|
- if (empty($prefix) || empty($suffix))
|
|
|
|
372
|
- continue;
|
|
|
|
373
|
$seo_title = $prefix . ' ' . $v[$this->topic_fields[$table]] . ' ' . $suffix;
|
382
|
$seo_title = $prefix . ' ' . $v[$this->topic_fields[$table]] . ' ' . $suffix;
|
|
374
|
- $data[$field] = $seo_title;
|
383
|
+ }
|
|
|
|
384
|
+
|
|
|
|
385
|
+ $data[$field] = trim($seo_title);
|
|
375
|
$update[$table]['title']++;
|
386
|
$update[$table]['title']++;
|
|
376
|
} else if ($table == 'gl_ai_blog_list' && $field == 'seo_title') {
|
387
|
} else if ($table == 'gl_ai_blog_list' && $field == 'seo_title') {
|
|
377
|
//直接使用 top blog
|
388
|
//直接使用 top blog
|
|
@@ -547,6 +558,9 @@ class UpdateSeoTdk extends Command |
|
@@ -547,6 +558,9 @@ class UpdateSeoTdk extends Command |
|
547
|
//去掉标题存在的词
|
558
|
//去掉标题存在的词
|
|
548
|
if ($topic) {
|
559
|
if ($topic) {
|
|
549
|
foreach ($fix_keyword as $k=>$keyword) {
|
560
|
foreach ($fix_keyword as $k=>$keyword) {
|
|
|
|
561
|
+ // 前后缀如果已经存在, 就不在拼接当前类型
|
|
|
|
562
|
+ if (FALSE !== strpos($topic, $keyword))
|
|
|
|
563
|
+ return $str;
|
|
550
|
//处理单词复数 s es ies ves
|
564
|
//处理单词复数 s es ies ves
|
|
551
|
$keyword = rtrim($keyword, 'ves');
|
565
|
$keyword = rtrim($keyword, 'ves');
|
|
552
|
$keyword = rtrim($keyword, 'ies');
|
566
|
$keyword = rtrim($keyword, 'ies');
|
|
@@ -700,3 +714,4 @@ class UpdateSeoTdk extends Command |
|
@@ -700,3 +714,4 @@ class UpdateSeoTdk extends Command |
|
700
|
return $mail->add($data);
|
714
|
return $mail->add($data);
|
|
701
|
}
|
715
|
}
|
|
702
|
}
|
716
|
}
|
|
|
|
717
|
+ |