|
...
|
...
|
@@ -12,6 +12,7 @@ use App\Models\Domain\DomainInfo; |
|
|
|
use App\Models\Mail\Mail;
|
|
|
|
use App\Models\Project\DeployBuild;
|
|
|
|
use App\Models\Project\DeployOptimize;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Project\ProjectKeyword;
|
|
|
|
use App\Models\Project\ProjectUpdateTdk;
|
|
|
|
use App\Models\User\User;
|
|
...
|
...
|
@@ -263,6 +264,7 @@ class UpdateSeoTdk extends Command |
|
|
|
public function seo_tdk($project_id, $task_id)
|
|
|
|
{
|
|
|
|
$notify_master = $notify_keyword = false;
|
|
|
|
$project = Project::find($project_id);
|
|
|
|
//更新统计
|
|
|
|
$update = [];
|
|
|
|
//AI指令 是否有定制指令
|
|
...
|
...
|
@@ -366,12 +368,21 @@ class UpdateSeoTdk extends Command |
|
|
|
}
|
|
|
|
} else if ($table == 'gl_product_keyword' && $field == 'seo_title') {
|
|
|
|
# TODO 聚合页seo title 特殊处理 前缀_1 . 关键词 . 后缀_2
|
|
|
|
$prefix = $this->getPrefixKeyword($project_id, 'prefix', 1, $v[$this->topic_fields[$table]]);
|
|
|
|
$suffix = $this->getPrefixKeyword($project_id, 'suffix', 2, $v[$this->topic_fields[$table]]);
|
|
|
|
if (empty($prefix) || empty($suffix))
|
|
|
|
continue;
|
|
|
|
$seo_title = $prefix . ' ' . $v[$this->topic_fields[$table]] . ' ' . $suffix;
|
|
|
|
$data[$field] = $seo_title;
|
|
|
|
$seo_title = '';
|
|
|
|
//只有推广项目才加 前后缀
|
|
|
|
if($project->type == Project::TYPE_TWO) {
|
|
|
|
$prefix = $this->getPrefixKeyword($project_id, 'prefix', 1);
|
|
|
|
$suffix = $this->getPrefixKeyword($project_id, 'suffix', 2);
|
|
|
|
if (empty($prefix) || empty($suffix)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$prefix = $this->getPrefixKeyword($project_id, 'prefix', 1, $v[$this->topic_fields[$table]]);
|
|
|
|
$suffix = $this->getPrefixKeyword($project_id, 'suffix', 2, $v[$this->topic_fields[$table]]);
|
|
|
|
$seo_title = $prefix . ' ' . $v[$this->topic_fields[$table]] . ' ' . $suffix;
|
|
|
|
}
|
|
|
|
|
|
|
|
$data[$field] = trim($seo_title);
|
|
|
|
$update[$table]['title']++;
|
|
|
|
} else if ($table == 'gl_ai_blog_list' && $field == 'seo_title') {
|
|
|
|
//直接使用 top blog
|
|
...
|
...
|
@@ -547,6 +558,9 @@ class UpdateSeoTdk extends Command |
|
|
|
//去掉标题存在的词
|
|
|
|
if ($topic) {
|
|
|
|
foreach ($fix_keyword as $k=>$keyword) {
|
|
|
|
// 前后缀如果已经存在, 就不在拼接当前类型
|
|
|
|
if (FALSE !== strpos($topic, $keyword))
|
|
|
|
return $str;
|
|
|
|
//处理单词复数 s es ies ves
|
|
|
|
$keyword = rtrim($keyword, 'ves');
|
|
|
|
$keyword = rtrim($keyword, 'ies');
|
|
...
|
...
|
@@ -700,3 +714,4 @@ class UpdateSeoTdk extends Command |
|
|
|
return $mail->add($data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|