From c6b3cad3847de13fa1cca83769ebcbd7041349ea Mon Sep 17 00:00:00 2001 From: cshaptx4869 <994774638@qq.com> Date: Mon, 12 Sep 2022 09:39:52 +0800 Subject: [PATCH] =?UTF-8?q?Mod:=20=E5=A2=9E=E5=8A=A0=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=8C=89=E8=8A=82=E7=82=B9=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/model/SystemAuth.php | 1 + app/admin/model/SystemNode.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/admin/model/SystemAuth.php b/app/admin/model/SystemAuth.php index 75f2394f..5eda89fa 100644 --- a/app/admin/model/SystemAuth.php +++ b/app/admin/model/SystemAuth.php @@ -37,6 +37,7 @@ public function getAuthorizeNodeListByAdminId($authId) $nodelList = $systemNode ->where('is_auth', 1) ->field('id,node,title,type,is_auth') + ->order(['node' => 'asc', 'id' => 'desc']) ->select() ->toArray(); $newNodeList = []; diff --git a/app/admin/model/SystemNode.php b/app/admin/model/SystemNode.php index e3f5dbc5..32aa3144 100644 --- a/app/admin/model/SystemNode.php +++ b/app/admin/model/SystemNode.php @@ -20,7 +20,9 @@ class SystemNode extends TimeModel public function getNodeTreeList() { - $list = $this->select()->toArray(); + $list = $this->order(['node' => 'asc', 'id' => 'desc']) + ->select() + ->toArray(); $list = $this->buildNodeTree($list); return $list; }