作者 赵彬吉

tdk update

... ... @@ -92,6 +92,21 @@ class UpdateSeoTdk extends Command
'blog_cat_meta_keywords' => 'seo_keywords',
'blog_cat_meta_description' => 'seo_des',
],
'gl_ai_blog' => [
'ai_blog_title' => 'seo_title',
'ai_blog_meta_keywords' => 'seo_keyword',
'ai_blog_meta_description' => 'seo_description',
],
'gl_ai_blog_list' => [
'ai_blog_cat_title' => 'seo_title',
'ai_blog_cat_meta_keywords' => 'seo_keyword',
'ai_blog_cat_meta_description' => 'seo_description',
],
'gl_ai_blog_author' => [
'ai_blog_author_title' => 'seo_title',
'ai_blog_author_meta_keywords' => 'seo_keyword',
'ai_blog_author_meta_description' => 'seo_description',
],
'gl_news' => [
'news_title' => 'seo_title',
'news_meta_keywords' => 'seo_keywords',
... ... @@ -131,6 +146,9 @@ class UpdateSeoTdk extends Command
'gl_product_category' => 'title',
'gl_blog' => 'name',
'gl_blog_category' => 'name',
'gl_ai_blog' => 'new_title',
'gl_ai_blog_list' => '', //直接使用 top blog
'gl_ai_blog_author' => 'title',
'gl_news' => 'name',
'gl_news_category' => 'name',
'gl_product_keyword' => 'title',
... ... @@ -149,7 +167,7 @@ class UpdateSeoTdk extends Command
];
/**
* '表' => 'C端页面更新的数据类型'
* '表' => 'C端页面更新的数据类型' 子表 route_map的source类型
* @return array
* @author akun
* @date 2024/11/14
... ... @@ -160,6 +178,9 @@ class UpdateSeoTdk extends Command
'gl_product_category' => 'product_category',
'gl_blog' => 'blog',
'gl_blog_category' => 'blog_category',
'gl_ai_blog' => 'ai_blog',
'gl_ai_blog_list' => 'ai_blog_list',
'gl_ai_blog_author' => 'ai_blog_author',
'gl_news' => 'news',
'gl_news_category' => 'news_category',
'gl_product_keyword' => 'product_keyword',
... ... @@ -179,6 +200,9 @@ class UpdateSeoTdk extends Command
'gl_product_category' => 'route',
'gl_blog' => 'url',
'gl_blog_category' => 'alias',
'gl_ai_blog' => 'route',
'gl_ai_blog_list' => 'route',
'gl_ai_blog_author' => 'route',
'gl_news' => 'url',
'gl_news_category' => 'alias',
'gl_product_keyword' => 'route',
... ... @@ -340,8 +364,7 @@ class UpdateSeoTdk extends Command
}
$data[$field] = $this->ai_send($prompt, $project_id, $table, $v['id']);
}
}
else if ($table == 'gl_product_keyword' && $field == 'seo_title') {
} 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]]);
... ... @@ -350,6 +373,10 @@ class UpdateSeoTdk extends Command
$seo_title = $prefix . ' ' . $v[$this->topic_fields[$table]] . ' ' . $suffix;
$data[$field] = $seo_title;
$update[$table]['title']++;
} else if ($table == 'gl_ai_blog_list' && $field == 'seo_title') {
//直接使用 top blog
$data[$field] = 'top blog';
$update[$table]['title']++;
} else {
//直接使用topic
if (count($field_arr) > 1) {
... ...