作者 lyh

gx

@@ -88,7 +88,7 @@ class UpdateSeoTdk extends Command @@ -88,7 +88,7 @@ class UpdateSeoTdk extends Command
88 $v = (array)$v; 88 $v = (array)$v;
89 $seo_arr = json_decode($v['seo_mate'], true) ?: []; 89 $seo_arr = json_decode($v['seo_mate'], true) ?: [];
90 //更新seo_title 90 //更新seo_title
91 - if(!isset($seo_arr['title'])){ 91 + if(!isset($seo_arr['title']) || empty($seo_arr['title'])){
92 $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first(); 92 $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first();
93 //生成seo_title 93 //生成seo_title
94 if(!empty($setting['product_prefix']) && !empty($setting['product_suffix'])){ 94 if(!empty($setting['product_prefix']) && !empty($setting['product_suffix'])){
@@ -98,11 +98,11 @@ class UpdateSeoTdk extends Command @@ -98,11 +98,11 @@ class UpdateSeoTdk extends Command
98 } 98 }
99 } 99 }
100 //更新seo_keyword 100 //更新seo_keyword
101 - if(!isset($seo_arr['keyword'])){ 101 + if(!isset($seo_arr['keyword']) || empty($seo_arr['keyword'])){
102 $seo_arr['keyword'] = $this->ai_send('seo_keywords',$v['title']); 102 $seo_arr['keyword'] = $this->ai_send('seo_keywords',$v['title']);
103 } 103 }
104 //更新seo_keyword 104 //更新seo_keyword
105 - if(!isset($seo_arr['description'])){ 105 + if(!isset($seo_arr['description']) || empty($seo_arr['description'])){
106 $seo_arr['description'] = $this->ai_send('seo_meta_description',$v['title']); 106 $seo_arr['description'] = $this->ai_send('seo_meta_description',$v['title']);
107 } 107 }
108 $ser_str = json_encode($seo_arr,true); 108 $ser_str = json_encode($seo_arr,true);