瀏覽代碼

增加分类数据返回

liaofei 2 年之前
父節點
當前提交
b4b32a139b

+ 2 - 2
crmeb/app/services/system/SystemRouteCateServices.php

@@ -69,9 +69,9 @@ class SystemRouteCateServices extends BaseServices
      * @email 136327134@qq.com
      * @date 2023/4/6
      */
-    public function getAllList(string $appName = 'outapi', string $field = '*')
+    public function getAllList(string $appName = 'outapi', string $field = '*', string $order = '')
     {
-        $list = $this->dao->selectList(['app_name' => $appName], $field)->toArray();
+        $list = $this->dao->selectList(['app_name' => $appName], $field, 0, 0, $order)->toArray();
         return get_tree_children($list);
     }
 

+ 3 - 1
crmeb/app/services/system/SystemRouteServices.php

@@ -68,7 +68,9 @@ class SystemRouteServices extends BaseServices
             throw new ValidateException('修改的路由不存在');
         }
 
-        return $routeInfo->toArray();
+        $routeInfo = $routeInfo->toArray();
+        $routeInfo['cate_tree'] = app()->make(SystemRouteCateServices::class)->getAllList($routeInfo['app_name'], '*', 'id asc,sort desc');
+        return $routeInfo;
     }
 
     /**