feat: optimize server.user.get hook definition

This commit is contained in:
xboard
2025-08-29 19:19:08 +08:00
parent 02c9bca336
commit 8e0384c833
4 changed files with 6 additions and 6 deletions
+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);
}
// 获取路由规则