浏览代码

rule为空不再返回当前所在对象

duqinya 5 年之前
父节点
当前提交
d43aef252d
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      app/Repositories/CmsContentTemplateSetRepository.php

+ 3 - 3
app/Repositories/CmsContentTemplateSetRepository.php

@@ -204,10 +204,10 @@ class CmsContentTemplateSetRepository
                     $new_rule[$key]['link_type'] = $value['link_type'];
                 }
             }
+            $group_array['content'][0]['area_type'] = "banner";
+            $group_array['content'][0]['id'] = $banner_rule->id ?? 0;
+            $group_array['content'][0]['rule'] = $new_rule;
         }
-        $group_array['content'][0]['area_type'] = "banner";
-        $group_array['content'][0]['id'] = $banner_rule->id ?? 0;
-        $group_array['content'][0]['rule'] = $new_rule;
 
         $all_subject = $this->cmsContentTemplateSet->select('id', 'rule', 'sort', 'name', 'floor_img', 'area_type')->where(['tpl_id' => $temalates->id, 'status' => 1])->whereIn('area_type', [4, 5])->orderBy('sort', 'asc')->get();
         $all_subject = $all_subject->toArray();