From 70e0785b21c1fb08cccb245cf70ca9111508f1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 23 Feb 2017 16:58:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8F=9C=E5=8D=95=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Index.php | 2 +- application/admin/controller/Menu.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index 369de9ac6..f63cea0cb 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -20,7 +20,7 @@ class Index extends BasicAdmin { * @return \think\response\View */ public function index() { - $list = Db::name('SystemMenu')->field('title,id,pid,url,icon')->where('status', '1')->select(); + $list = Db::name('SystemMenu')->field('title,id,pid,url,icon')->order('sort asc,id asc')->where('status', '1')->select(); $menus = $this->_filter_menu(Tools::arr2tree($list)); $this->assign('title', '后台管理'); $this->assign('menus', $menus); diff --git a/application/admin/controller/Menu.php b/application/admin/controller/Menu.php index c84a89ce0..6d0d670eb 100644 --- a/application/admin/controller/Menu.php +++ b/application/admin/controller/Menu.php @@ -28,7 +28,8 @@ class Menu extends BasicAdmin { */ public function index() { $this->title = '系统菜单管理'; - parent::_list($this->table, false); + $db = Db::name($this->table)->order('sort asc,id asc'); + parent::_list($db, false); } /**