feat: optimize server.user.get hook definition

This commit is contained in:
xboard committed 2025-08-29 19:21:49 +08:00
1 parent 1edc401ca0
commit 4f7f3d7168
4 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -65,10 +65,10 @@ class ServerService
* @param array $groupIds
* @return Collection
*/
public static function getAvailableUsers(array $groupIds)
public static function getAvailableUsers(Server $node)
{
$users = User::toBase()
->whereIn('group_id', $groupIds)
->whereIn('group_id', $node->group_ids)
->whereRaw('u + d < transfer_enable')
->where(function ($query) {
$query->where('expired_at', '>=', time())
@@ -82,7 +82,7 @@ class ServerService
'device_limit'
])
->get();
return HookManager::filter('server.users.get', $users, $groupIds);
return HookManager::filter('server.users.get', $users, $node);
}
// 获取路由规则