feat: add v2node support

This commit is contained in:
xboard
2025-11-22 20:33:38 +08:00
parent 8d0e33ba23
commit 95e8e7bca7
5 changed files with 50 additions and 9 deletions

View File

@@ -98,10 +98,12 @@ class ServerService
* @param string $serverType
* @return Server|null
*/
public static function getServer($serverId, $serverType)
public static function getServer($serverId, ?string $serverType)
{
return Server::query()
->where('type', Server::normalizeType($serverType))
->when($serverType, function ($query) use ($serverType) {
$query->where('type', Server::normalizeType($serverType));
})
->where(function ($query) use ($serverId) {
$query->where('code', $serverId)
->orWhere('id', $serverId);