作者 刘锟

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

@@ -306,7 +306,7 @@ class DownloadProject extends Command @@ -306,7 +306,7 @@ class DownloadProject extends Command
306 } 306 }
307 $arr[] = $content4; 307 $arr[] = $content4;
308 foreach ($arr as $key => $val){ 308 foreach ($arr as $key => $val){
309 - $content .= ($key+1).','.$val; 309 + $content .= ($key+1).','.$val."\n";
310 } 310 }
311 $timestamp = strtotime('tomorrow 9:00 AM'); 311 $timestamp = strtotime('tomorrow 9:00 AM');
312 $tomorrowNineAM = date('Y-m-d H:i:s', $timestamp); 312 $tomorrowNineAM = date('Y-m-d H:i:s', $timestamp);
@@ -314,7 +314,7 @@ class DownloadProject extends Command @@ -314,7 +314,7 @@ class DownloadProject extends Command
314 'project_id'=>$project_id, 314 'project_id'=>$project_id,
315 'friend_id'=>1, 315 'friend_id'=>1,
316 'type'=>MessagePush::TYPE_WEEK, 316 'type'=>MessagePush::TYPE_WEEK,
317 - 'content'=>$content, 317 + 'content'=>"【全球搜V6.0周报】"."\n".$content,
318 'ref_ids'=>'', 318 'ref_ids'=>'',
319 'send_time'=>$tomorrowNineAM, 319 'send_time'=>$tomorrowNineAM,
320 'status'=>3, 320 'status'=>3,
@@ -237,7 +237,7 @@ class WeekProject extends Command @@ -237,7 +237,7 @@ class WeekProject extends Command
237 } 237 }
238 $arr[] = $content4; 238 $arr[] = $content4;
239 foreach ($arr as $key => $val){ 239 foreach ($arr as $key => $val){
240 - $content .= ($key + 1) .','.$val; 240 + $content .= ($key + 1) .','.$val.PHP_EOL;
241 } 241 }
242 $timestamp = strtotime('tomorrow 9:00 AM'); 242 $timestamp = strtotime('tomorrow 9:00 AM');
243 $tomorrowNineAM = date('Y-m-d H:i:s', $timestamp); 243 $tomorrowNineAM = date('Y-m-d H:i:s', $timestamp);
@@ -245,7 +245,7 @@ class WeekProject extends Command @@ -245,7 +245,7 @@ class WeekProject extends Command
245 'project_id'=>$project_id, 245 'project_id'=>$project_id,
246 'friend_id'=>$friend_id, 246 'friend_id'=>$friend_id,
247 'type'=>MessagePush::TYPE_WEEK, 247 'type'=>MessagePush::TYPE_WEEK,
248 - 'content'=>'【全球搜V6.0周报】'.$content, 248 + 'content'=>'【全球搜V6.0周报】'.PHP_EOL.$content,
249 'ref_ids'=>'', 249 'ref_ids'=>'',
250 'send_time'=>$tomorrowNineAM 250 'send_time'=>$tomorrowNineAM
251 ]; 251 ];
@@ -92,6 +92,21 @@ class UpdateSeoTdk extends Command @@ -92,6 +92,21 @@ class UpdateSeoTdk extends Command
92 'blog_cat_meta_keywords' => 'seo_keywords', 92 'blog_cat_meta_keywords' => 'seo_keywords',
93 'blog_cat_meta_description' => 'seo_des', 93 'blog_cat_meta_description' => 'seo_des',
94 ], 94 ],
  95 + 'gl_ai_blog' => [
  96 + 'ai_blog_title' => 'seo_title',
  97 + 'ai_blog_meta_keywords' => 'seo_keyword',
  98 + 'ai_blog_meta_description' => 'seo_description',
  99 + ],
  100 + 'gl_ai_blog_list' => [
  101 + 'ai_blog_cat_title' => 'seo_title',
  102 + 'ai_blog_cat_meta_keywords' => 'seo_keyword',
  103 + 'ai_blog_cat_meta_description' => 'seo_description',
  104 + ],
  105 + 'gl_ai_blog_author' => [
  106 + 'ai_blog_author_title' => 'seo_title',
  107 + 'ai_blog_author_meta_keywords' => 'seo_keyword',
  108 + 'ai_blog_author_meta_description' => 'seo_description',
  109 + ],
95 'gl_news' => [ 110 'gl_news' => [
96 'news_title' => 'seo_title', 111 'news_title' => 'seo_title',
97 'news_meta_keywords' => 'seo_keywords', 112 'news_meta_keywords' => 'seo_keywords',
@@ -131,6 +146,9 @@ class UpdateSeoTdk extends Command @@ -131,6 +146,9 @@ class UpdateSeoTdk extends Command
131 'gl_product_category' => 'title', 146 'gl_product_category' => 'title',
132 'gl_blog' => 'name', 147 'gl_blog' => 'name',
133 'gl_blog_category' => 'name', 148 'gl_blog_category' => 'name',
  149 + 'gl_ai_blog' => 'new_title',
  150 + 'gl_ai_blog_list' => '', //直接使用 top blog
  151 + 'gl_ai_blog_author' => 'title',
134 'gl_news' => 'name', 152 'gl_news' => 'name',
135 'gl_news_category' => 'name', 153 'gl_news_category' => 'name',
136 'gl_product_keyword' => 'title', 154 'gl_product_keyword' => 'title',
@@ -149,7 +167,7 @@ class UpdateSeoTdk extends Command @@ -149,7 +167,7 @@ class UpdateSeoTdk extends Command
149 ]; 167 ];
150 168
151 /** 169 /**
152 - * '表' => 'C端页面更新的数据类型' 170 + * '表' => 'C端页面更新的数据类型' 子表 route_map的source类型
153 * @return array 171 * @return array
154 * @author akun 172 * @author akun
155 * @date 2024/11/14 173 * @date 2024/11/14
@@ -160,6 +178,9 @@ class UpdateSeoTdk extends Command @@ -160,6 +178,9 @@ class UpdateSeoTdk extends Command
160 'gl_product_category' => 'product_category', 178 'gl_product_category' => 'product_category',
161 'gl_blog' => 'blog', 179 'gl_blog' => 'blog',
162 'gl_blog_category' => 'blog_category', 180 'gl_blog_category' => 'blog_category',
  181 + 'gl_ai_blog' => 'ai_blog',
  182 + 'gl_ai_blog_list' => 'ai_blog_list',
  183 + 'gl_ai_blog_author' => 'ai_blog_author',
163 'gl_news' => 'news', 184 'gl_news' => 'news',
164 'gl_news_category' => 'news_category', 185 'gl_news_category' => 'news_category',
165 'gl_product_keyword' => 'product_keyword', 186 'gl_product_keyword' => 'product_keyword',
@@ -179,6 +200,9 @@ class UpdateSeoTdk extends Command @@ -179,6 +200,9 @@ class UpdateSeoTdk extends Command
179 'gl_product_category' => 'route', 200 'gl_product_category' => 'route',
180 'gl_blog' => 'url', 201 'gl_blog' => 'url',
181 'gl_blog_category' => 'alias', 202 'gl_blog_category' => 'alias',
  203 + 'gl_ai_blog' => 'route',
  204 + 'gl_ai_blog_list' => 'route',
  205 + 'gl_ai_blog_author' => 'route',
182 'gl_news' => 'url', 206 'gl_news' => 'url',
183 'gl_news_category' => 'alias', 207 'gl_news_category' => 'alias',
184 'gl_product_keyword' => 'route', 208 'gl_product_keyword' => 'route',
@@ -340,8 +364,7 @@ class UpdateSeoTdk extends Command @@ -340,8 +364,7 @@ class UpdateSeoTdk extends Command
340 } 364 }
341 $data[$field] = $this->ai_send($prompt, $project_id, $table, $v['id']); 365 $data[$field] = $this->ai_send($prompt, $project_id, $table, $v['id']);
342 } 366 }
343 - }  
344 - else if ($table == 'gl_product_keyword' && $field == 'seo_title') { 367 + } else if ($table == 'gl_product_keyword' && $field == 'seo_title') {
345 # TODO 聚合页seo title 特殊处理 前缀_1 . 关键词 . 后缀_2 368 # TODO 聚合页seo title 特殊处理 前缀_1 . 关键词 . 后缀_2
346 $prefix = $this->getPrefixKeyword($project_id, 'prefix', 1, $v[$this->topic_fields[$table]]); 369 $prefix = $this->getPrefixKeyword($project_id, 'prefix', 1, $v[$this->topic_fields[$table]]);
347 $suffix = $this->getPrefixKeyword($project_id, 'suffix', 2, $v[$this->topic_fields[$table]]); 370 $suffix = $this->getPrefixKeyword($project_id, 'suffix', 2, $v[$this->topic_fields[$table]]);
@@ -350,6 +373,10 @@ class UpdateSeoTdk extends Command @@ -350,6 +373,10 @@ class UpdateSeoTdk extends Command
350 $seo_title = $prefix . ' ' . $v[$this->topic_fields[$table]] . ' ' . $suffix; 373 $seo_title = $prefix . ' ' . $v[$this->topic_fields[$table]] . ' ' . $suffix;
351 $data[$field] = $seo_title; 374 $data[$field] = $seo_title;
352 $update[$table]['title']++; 375 $update[$table]['title']++;
  376 + } else if ($table == 'gl_ai_blog_list' && $field == 'seo_title') {
  377 + //直接使用 top blog
  378 + $data[$field] = 'top blog';
  379 + $update[$table]['title']++;
353 } else { 380 } else {
354 //直接使用topic 381 //直接使用topic
355 if (count($field_arr) > 1) { 382 if (count($field_arr) > 1) {
@@ -41,7 +41,6 @@ class ProductLogic extends BaseLogic @@ -41,7 +41,6 @@ class ProductLogic extends BaseLogic
41 * @time :2023/8/21 18:35 41 * @time :2023/8/21 18:35
42 */ 42 */
43 public function productSave(){ 43 public function productSave(){
44 - try {  
45 if(isset($this->param['id']) && !empty($this->param['id'])){ 44 if(isset($this->param['id']) && !empty($this->param['id'])){
46 $data = $this->editProduct(); 45 $data = $this->editProduct();
47 }else{ 46 }else{
@@ -51,10 +50,6 @@ class ProductLogic extends BaseLogic @@ -51,10 +50,6 @@ class ProductLogic extends BaseLogic
51 KeywordRelated::saveRelated($data['id'],$this->param['keyword_id'] ?? []);//关键字关联 50 KeywordRelated::saveRelated($data['id'],$this->param['keyword_id'] ?? []);//关键字关联
52 $this->saveExtendInfo($data['id'],$this->param['extend'] ?? []);//扩展字段 51 $this->saveExtendInfo($data['id'],$this->param['extend'] ?? []);//扩展字段
53 $this->saveDetail($data['id'],$this->param['detail'] ?? []); 52 $this->saveDetail($data['id'],$this->param['detail'] ?? []);
54 - }catch (\Exception $e){  
55 - Log::info('错误信息---'.$e->getMessage());  
56 - $this->fail('系统错误,请联系管理员');  
57 - }  
58 $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$data['route'] ?? ''); 53 $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$data['route'] ?? '');
59 $this->curlDelRoute(['new_route'=>$data['route'] ?? '']); 54 $this->curlDelRoute(['new_route'=>$data['route'] ?? '']);
60 return $this->success(['id'=>$data['id']]); 55 return $this->success(['id'=>$data['id']]);