作者 李宇航

合并分支 'lyh-server' 到 'master'

gx数据



查看合并请求 !1443
@@ -529,17 +529,17 @@ class UpdateRoute extends Command @@ -529,17 +529,17 @@ class UpdateRoute extends Command
529 public function updateSeo($project_id){ 529 public function updateSeo($project_id){
530 $seoModel = new WebSettingSeo(); 530 $seoModel = new WebSettingSeo();
531 $seo_info = $seoModel->read(['project_id'=>$project_id]); 531 $seo_info = $seoModel->read(['project_id'=>$project_id]);
532 - $prefix = $seo_info['product_category_prefix'] ?? [];  
533 - $suffix = $seo_info['product_category_suffix'] ?? [];  
534 - if(!empty($seo_info)){ 532 + if($seo_info !== false){
  533 + $prefix = $seo_info['product_category_prefix'] ?? [];
  534 + $suffix = $seo_info['product_category_suffix'] ?? [];
535 if(!empty($seo_info['product_cate_prefix'])){ 535 if(!empty($seo_info['product_cate_prefix'])){
536 $prefix[] = ['name'=>$seo_info['product_cate_prefix']]; 536 $prefix[] = ['name'=>$seo_info['product_cate_prefix']];
537 } 537 }
538 if(!empty($seo_info['product_cate_suffix'])){ 538 if(!empty($seo_info['product_cate_suffix'])){
539 $suffix[] = ['name'=>$seo_info['product_cate_suffix']]; 539 $suffix[] = ['name'=>$seo_info['product_cate_suffix']];
540 } 540 }
  541 + $seoModel->edit(['product_category_prefix'=>json_encode($prefix,true),'product_category_suffix'=>json_encode($suffix,true)],['project_id'=>$project_id]);
541 } 542 }
542 - $seoModel->edit(['product_category_prefix'=>json_encode($prefix,true),'product_category_suffix'=>json_encode($suffix,true)],['project_id'=>$project_id]);  
543 return true; 543 return true;
544 } 544 }
545 } 545 }