Finish mzl_dev

This commit is contained in:
mzl
2025-07-13 22:14:39 +08:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -53,6 +53,6 @@ class Role extends Model
// 角色拥有的资源(权限点、菜单)
public function resources()
{
return $this->belongsToMany(Resource::class, 'role_resources', 'role_id', 'resource_id');
return $this->belongsToMany(Resource::class, 'role_resources', 'role_id', 'resource_id')->orderBy('sort', 'asc');
}
}
+1 -1
View File
@@ -75,7 +75,7 @@ class User extends Model
// 用户直接拥有的资源(用于特殊补权)
public function resources()
{
return $this->belongsToMany(Resource::class, 'user_resources', 'user_id', 'resource_id');
return $this->belongsToMany(Resource::class, 'user_resources', 'user_id', 'resource_id')->orderBy('sort', 'asc');
}
// 用户可访问的系统