增加分类数据返回

This commit is contained in:
liaofei 2023-04-11 09:16:27 +08:00
parent 63ecfbdd92
commit b4b32a139b
2 changed files with 5 additions and 3 deletions

View File

@ -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);
}

View File

@ -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;
}
/**