修改排序

This commit is contained in:
JaguarJack 2020-06-17 13:24:02 +08:00
parent 6977442b05
commit 13d3734dba
2 changed files with 3 additions and 4 deletions

View File

@ -38,7 +38,7 @@ class Department extends CatchModel
return $this->withoutField(['department_name']) return $this->withoutField(['department_name'])
->addFields(['department_name as title']) ->addFields(['department_name as title'])
->catchSearch() ->catchSearch()
->order() ->catchOrder()
->select()->toArray(); ->select()->toArray();
} }
} }

View File

@ -44,8 +44,7 @@ class Permissions extends CatchModel
public function getList($isMenu = false) public function getList($isMenu = false)
{ {
return $this->catchSearch() return $this->catchSearch()
->order('sort', 'desc') ->catchOrder()
->order('id', 'desc')
->when($isMenu, function ($query){ ->when($isMenu, function ($query){
$query->where('type', self::MENU_TYPE); $query->where('type', self::MENU_TYPE);
}) })
@ -74,7 +73,7 @@ class Permissions extends CatchModel
'route', 'icon', 'component', 'redirect', 'route', 'icon', 'component', 'redirect',
'keepalive as keepAlive', 'hide_children_in_menu', 'type', 'permission_mark', 'status' 'keepalive as keepAlive', 'hide_children_in_menu', 'type', 'permission_mark', 'status'
]) ])
->order() ->catchOrder()
->select(); ->select();
} }