duqinya 6 éve
szülő
commit
055d9a0d03
1 módosított fájl, 1 hozzáadás és 12 törlés
  1. 1 12
      app/Repositories/CmsContentTemplateSetRepository.php

+ 1 - 12
app/Repositories/CmsContentTemplateSetRepository.php

@@ -417,19 +417,8 @@ class CmsContentTemplateSetRepository {
 
     public function getTemplate($cityId)
     {
-        $template = $this->cmsContentTemplate->select('id','title','apply_type')->where(['city_id'=>$cityId,'deleted_at'=>null])->orderBy('apply_type','asc')->get();
+        return $this->cmsContentTemplate->select('id','title','apply_type')->where(['city_id'=>$cityId,'deleted_at'=>null])->orderBy('apply_type','asc')->get();
 
-        $templates = $template->toArray();
-            $tmp_arr = array();
-            foreach($templates as $key => $val) {
-                if(in_array($val['title'],$tmp_arr)) {  //搜索$val['title']是否在$tmp_arr数组中存在,若存在返回true
-                    unset($templates[$key]);
-                } else {
-                    $tmp_arr[] = $val['title'];
-                }
-            }
-            sort($templates);
-            return $templates;
     }
 
     public function templateSetDelete($request)