正在显示
1 个修改的文件
包含
1 行增加
和
3 行删除
| @@ -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 |
-
请 注册 或 登录 后发表评论