From a2a179b26e43805da0bd09f48f573d74a82a650e Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 24 Aug 2023 10:14:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/lists/user/UserMenuLists.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/adminapi/lists/user/UserMenuLists.php b/app/adminapi/lists/user/UserMenuLists.php index 40222dc26..cbc0de1f6 100644 --- a/app/adminapi/lists/user/UserMenuLists.php +++ b/app/adminapi/lists/user/UserMenuLists.php @@ -54,12 +54,13 @@ class UserMenuLists extends BaseAdminDataLists implements ListsSearchInterface */ public function lists(): array { - return UserMenu::where($this->searchWhere) + $lists = UserMenu::where($this->searchWhere) ->field(['id', 'pid', 'type', 'name', 'icon', 'sort', 'paths', 'params', 'is_show', 'is_disable']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); + return linear_to_tree($lists, 'children'); } @@ -73,5 +74,4 @@ class UserMenuLists extends BaseAdminDataLists implements ListsSearchInterface { return UserMenu::where($this->searchWhere)->count(); } - -} \ No newline at end of file +}