mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 03:57:27 +08:00
feat: optimize server.user.get hook definition
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
// 获取路由规则
|
||||
|
||||
Reference in New Issue
Block a user