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