浏览代码

返回格式调整

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

+ 3 - 4
app/Repositories/CmsContentTemplateSetRepository.php

@@ -421,7 +421,7 @@ class CmsContentTemplateSetRepository {
 
     public function getTemplate($cityId)
     {
-        $group = $this->cmsContentTemplate->select('id','status','title','apply_type')->where(['city_id'=>$cityId,'deleted_at'=>null,'apply_type'=>0])->get();//->orderBy('apply_type','asc')
+        $group = $this->cmsContentTemplate->select('id','status','title','apply_type')->where(['city_id'=>$cityId,'deleted_at'=>null,'apply_type'=>0])->get();
         $groups = $group->toArray();
         if (count($groups)>1){
             foreach($groups as $key => $val) {
@@ -430,7 +430,7 @@ class CmsContentTemplateSetRepository {
                 }
             }
         }
-        $market = $this->cmsContentTemplate->select('id','status','title','apply_type')->where(['city_id'=>$cityId,'deleted_at'=>null,'apply_type'=>1])->get();//->orderBy('apply_type','asc')
+        $market = $this->cmsContentTemplate->select('id','status','title','apply_type')->where(['city_id'=>$cityId,'deleted_at'=>null,'apply_type'=>1])->get();
         $markets = $market->toArray();
         if (count($markets)>1){
             foreach($markets as $key => $val) {
@@ -439,8 +439,7 @@ class CmsContentTemplateSetRepository {
                 }
             }
         }
-        $templates = array_merge($groups,$markets);
-        
+        $templates['cms_content_templates'] = array_merge($groups,$markets);
         return $templates;
     }