refactor(server): optimize server lookup with prioritized code matching

This commit is contained in:
xboard 2025-01-07 23:32:26 -05:00
parent 957aebd56c
commit 82ef9f3442

View File

@ -99,6 +99,7 @@ class ServerService
$query->where('code', $serverId)
->orWhere('id', $serverId);
})
->orderByRaw('CASE WHEN code = ? THEN 0 ELSE 1 END', [$serverId])
->first();
}
}