作者 赵彬吉

update

@@ -80,8 +80,7 @@ class UpdateSeoTdk extends Command @@ -80,8 +80,7 @@ class UpdateSeoTdk extends Command
80 if(!empty($list)){ 80 if(!empty($list)){
81 foreach ($list as $v){ 81 foreach ($list as $v){
82 $v = (array)$v; 82 $v = (array)$v;
83 - if(!empty($v['seo_mate'])){  
84 - $seo_arr = json_decode($v['seo_mate'], true); 83 + $seo_arr = json_decode($v['seo_mate'], true) ?: [];
85 //更新seo_title 84 //更新seo_title
86 if(!isset($seo_arr['title'])){ 85 if(!isset($seo_arr['title'])){
87 //生成seo_title 86 //生成seo_title
@@ -99,7 +98,6 @@ class UpdateSeoTdk extends Command @@ -99,7 +98,6 @@ class UpdateSeoTdk extends Command
99 DB::connection('custom_mysql')->table('gl_product')->where(['id'=>$v['id']])->update(['seo_mate'=>$ser_str]); 98 DB::connection('custom_mysql')->table('gl_product')->where(['id'=>$v['id']])->update(['seo_mate'=>$ser_str]);
100 } 99 }
101 } 100 }
102 - }  
103 return true; 101 return true;
104 } 102 }
105 103