更新菜单排序

This commit is contained in:
邹景立 2017-02-23 16:58:46 +08:00
parent c0e453b445
commit 70e0785b21
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

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