|
...
|
...
|
@@ -104,21 +104,7 @@ class SplicePrefix extends Command |
|
|
|
|
|
|
|
// 没有 SEO Title 直接生成
|
|
|
|
if (empty($item->seo_title)) {
|
|
|
|
$prefix = $tdk_class->getPrefixKeyword($project_id, 'prefix', 2, $item->title);
|
|
|
|
$suffix = $tdk_class->getPrefixKeyword($project_id, 'suffix', 2, trim($prefix . ' ' . $item->title));
|
|
|
|
if (Str::startsWith($suffix, ', ')) {
|
|
|
|
$seo_title = $prefix . ' ' . $item->title . $suffix;
|
|
|
|
} else {
|
|
|
|
$seo_title = $prefix . ' ' . $item->title . ' ' . $suffix;
|
|
|
|
}
|
|
|
|
$item->seo_title = trim($seo_title);
|
|
|
|
$item->save();
|
|
|
|
|
|
|
|
//存入按需更新表
|
|
|
|
UpdateNotify::addUpdateItem($project_id, 'product_keyword', $item->route);
|
|
|
|
$notify_master = true;
|
|
|
|
|
|
|
|
$this->output('new seo title: ' . $seo_title);
|
|
|
|
$this->output('没有seo_title');
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|