作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

@@ -30,7 +30,7 @@ class UpdateSeoTdk extends Command @@ -30,7 +30,7 @@ class UpdateSeoTdk extends Command
30 * 30 *
31 * @var string 31 * @var string
32 */ 32 */
33 - protected $description = ''; 33 + protected $description = '一键生成sdk';
34 34
35 /** 35 /**
36 * Create a new command instance. 36 * Create a new command instance.
@@ -85,7 +85,7 @@ class UpdateSeoTdk extends Command @@ -85,7 +85,7 @@ class UpdateSeoTdk extends Command
85 $v = (array)$v; 85 $v = (array)$v;
86 $seo_arr = json_decode($v['seo_mate'], true) ?: []; 86 $seo_arr = json_decode($v['seo_mate'], true) ?: [];
87 //更新seo_title 87 //更新seo_title
88 - if(!isset($seo_arr['title'])){ 88 + if(!isset($seo_arr['title']) || empty($seo_arr['title'])){
89 $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first(); 89 $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first();
90 //生成seo_title 90 //生成seo_title
91 if(!empty($setting['product_prefix']) && !empty($setting['product_suffix'])){ 91 if(!empty($setting['product_prefix']) && !empty($setting['product_suffix'])){
@@ -95,11 +95,11 @@ class UpdateSeoTdk extends Command @@ -95,11 +95,11 @@ class UpdateSeoTdk extends Command
95 } 95 }
96 } 96 }
97 //更新seo_keyword 97 //更新seo_keyword
98 - if(!isset($seo_arr['keyword'])){ 98 + if(!isset($seo_arr['keyword']) || empty($seo_arr['keyword'])){
99 $seo_arr['keyword'] = $this->ai_send('seo_keywords',$v['title']); 99 $seo_arr['keyword'] = $this->ai_send('seo_keywords',$v['title']);
100 } 100 }
101 //更新seo_keyword 101 //更新seo_keyword
102 - if(!isset($seo_arr['description'])){ 102 + if(!isset($seo_arr['description']) || empty($seo_arr['description'])){
103 $seo_arr['description'] = $this->ai_send('seo_meta_description',$v['title']); 103 $seo_arr['description'] = $this->ai_send('seo_meta_description',$v['title']);
104 } 104 }
105 $ser_str = json_encode($seo_arr,true); 105 $ser_str = json_encode($seo_arr,true);