duqinya hace 6 años
padre
commit
85d67e6d52
Se han modificado 1 ficheros con 10 adiciones y 1 borrados
  1. 10 1
      app/Repositories/CmsContentTemplateSetRepository.php

+ 10 - 1
app/Repositories/CmsContentTemplateSetRepository.php

@@ -421,8 +421,17 @@ class CmsContentTemplateSetRepository {
 
     public function getTemplate($cityId)
     {
-        return $this->cmsContentTemplate->select('id','title','apply_type')->where(['city_id'=>$cityId,'deleted_at'=>null])->orderBy('apply_type','asc')->get();
+        $template = $this->cmsContentTemplate->select('id','status','title','apply_type')->where(['city_id'=>$cityId,'deleted_at'=>null])->orderBy('apply_type','asc')->get();
+        $templates = $template->toArray();
+            foreach($templates as $key => $val) {
+                if ($val['status'] == 1) {
+                    unset($templates[$key]);
+                }
+            }
+
+        array_multisort(array_column($templates,'apply_type'),SORT_ASC,$templates);
 
+        return $templates;
     }
 
     public function templateSetDelete($request)