From 5ad4d21f756cceb03dfcb1396c7535d1ea01b570 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Mon, 10 Apr 2023 11:08:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/model/system/SystemRouteCate.php | 2 +- crmeb/app/services/system/SystemRouteServices.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crmeb/app/model/system/SystemRouteCate.php b/crmeb/app/model/system/SystemRouteCate.php index 73509e515..354960a74 100644 --- a/crmeb/app/model/system/SystemRouteCate.php +++ b/crmeb/app/model/system/SystemRouteCate.php @@ -39,6 +39,6 @@ class SystemRouteCate extends BaseModel */ public function children() { - return $this->hasMany(SystemRoute::class, 'id', 'cate_id')->field(['id', 'cate_id', 'name', 'path', 'method'])->order('add_time desc'); + return $this->hasMany(SystemRoute::class, 'cate_id', 'id')->field(['id', 'cate_id', 'name', 'path', 'method'])->order('add_time desc'); } } diff --git a/crmeb/app/services/system/SystemRouteServices.php b/crmeb/app/services/system/SystemRouteServices.php index 32fbe799f..f11ea60d3 100644 --- a/crmeb/app/services/system/SystemRouteServices.php +++ b/crmeb/app/services/system/SystemRouteServices.php @@ -82,7 +82,7 @@ class SystemRouteServices extends BaseServices public function getTreeList(array $where, string $appName = 'adminapi') { $list = app()->make(SystemRouteCateServices::class) - ->selectList(['app_name' => $appName], '*', 0, 0, 'id asc', [ + ->selectList(['app_name' => $appName], '*', 0, 0, 'id asc,sort desc', [ 'children' => function ($query) use ($where) { $query->where('app_name', $where['app_name']) ->when('' !== $where['name_like'], function ($q) use ($where) {