菜单排序

This commit is contained in:
liu
2026-08-09 11:30:48 +08:00
parent 6a9f16e2da
commit 1890c5882b
@@ -84,11 +84,12 @@ class IndexController extends BaseController
$menus = SysRuleModel::query()
->where('status', 1)
->whereIn('type', ['menu','route'])
->orderBy('order')
->get()
->toArray();
} else {
$roles = SysUserModel::with(['roles.rules' => function ($query) {
$query->where('status', 1)->whereIn('type', ['menu','route']);
$query->where('status', 1)->whereIn('type', ['menu','route'])->orderBy('order');
}])->find($id)->roles->toArray();
$menus = collect($roles)