mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-03-14 00:38:13 -04:00
refactor(server): optimize server lookup with prioritized code matching
This commit is contained in:
parent
957aebd56c
commit
82ef9f3442
@ -99,6 +99,7 @@ class ServerService
|
|||||||
$query->where('code', $serverId)
|
$query->where('code', $serverId)
|
||||||
->orWhere('id', $serverId);
|
->orWhere('id', $serverId);
|
||||||
})
|
})
|
||||||
|
->orderByRaw('CASE WHEN code = ? THEN 0 ELSE 1 END', [$serverId])
|
||||||
->first();
|
->first();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user