feat: add multiple hooks, pligun schedule support ,add hook:list artisan command

This commit is contained in:
xboard
2025-07-21 13:29:17 +08:00
parent 768e14bdb9
commit c9bab8fb02
16 changed files with 271 additions and 75 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Services;
use App\Models\Server;
use App\Models\ServerRoute;
use App\Models\User;
use App\Services\Plugin\HookManager;
use App\Utils\Helper;
use Illuminate\Support\Collection;
@@ -66,7 +67,7 @@ class ServerService
*/
public static function getAvailableUsers(array $groupIds)
{
return User::toBase()
$users = User::toBase()
->whereIn('group_id', $groupIds)
->whereRaw('u + d < transfer_enable')
->where(function ($query) {
@@ -81,6 +82,7 @@ class ServerService
'device_limit'
])
->get();
return HookManager::filter('server.users.get', $users, $groupIds);
}
// 获取路由规则