作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -306,7 +306,7 @@ class DownloadProject extends Command
}
$arr[] = $content4;
foreach ($arr as $key => $val){
$content .= ($key+1).','.$val;
$content .= ($key+1).','.$val."\n";
}
$timestamp = strtotime('tomorrow 9:00 AM');
$tomorrowNineAM = date('Y-m-d H:i:s', $timestamp);
... ... @@ -314,7 +314,7 @@ class DownloadProject extends Command
'project_id'=>$project_id,
'friend_id'=>1,
'type'=>MessagePush::TYPE_WEEK,
'content'=>$content,
'content'=>"【全球搜V6.0周报】"."\n".$content,
'ref_ids'=>'',
'send_time'=>$tomorrowNineAM,
'status'=>3,
... ...
... ... @@ -237,7 +237,7 @@ class WeekProject extends Command
}
$arr[] = $content4;
foreach ($arr as $key => $val){
$content .= ($key + 1) .','.$val;
$content .= ($key + 1) .','.$val.PHP_EOL;
}
$timestamp = strtotime('tomorrow 9:00 AM');
$tomorrowNineAM = date('Y-m-d H:i:s', $timestamp);
... ... @@ -245,7 +245,7 @@ class WeekProject extends Command
'project_id'=>$project_id,
'friend_id'=>$friend_id,
'type'=>MessagePush::TYPE_WEEK,
'content'=>'【全球搜V6.0周报】'.$content,
'content'=>'【全球搜V6.0周报】'.PHP_EOL.$content,
'ref_ids'=>'',
'send_time'=>$tomorrowNineAM
];
... ...
... ... @@ -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) {
... ...
... ... @@ -41,20 +41,15 @@ class ProductLogic extends BaseLogic
* @time :2023/8/21 18:35
*/
public function productSave(){
try {
if(isset($this->param['id']) && !empty($this->param['id'])){
$data = $this->editProduct();
}else{
$data = $this->addProduct();
}
CategoryRelated::saveRelated($data['id'], $this->param['category_id'] ?? []);//分类关联
KeywordRelated::saveRelated($data['id'],$this->param['keyword_id'] ?? []);//关键字关联
$this->saveExtendInfo($data['id'],$this->param['extend'] ?? []);//扩展字段
$this->saveDetail($data['id'],$this->param['detail'] ?? []);
}catch (\Exception $e){
Log::info('错误信息---'.$e->getMessage());
$this->fail('系统错误,请联系管理员');
if(isset($this->param['id']) && !empty($this->param['id'])){
$data = $this->editProduct();
}else{
$data = $this->addProduct();
}
CategoryRelated::saveRelated($data['id'], $this->param['category_id'] ?? []);//分类关联
KeywordRelated::saveRelated($data['id'],$this->param['keyword_id'] ?? []);//关键字关联
$this->saveExtendInfo($data['id'],$this->param['extend'] ?? []);//扩展字段
$this->saveDetail($data['id'],$this->param['detail'] ?? []);
$this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$data['route'] ?? '');
$this->curlDelRoute(['new_route'=>$data['route'] ?? '']);
return $this->success(['id'=>$data['id']]);
... ...