mirror of
https://github.com/Deathgarden-Rebirth/Deathgarden_Rebirth-Rewrite.git
synced 2026-09-07 10:45:52 -05:00
Fix for the leaderboard query not showing enough people below you when you are first, second or third place
This commit is contained in:
@@ -109,8 +109,7 @@ public static function getLeaderboardEntriesForPlayer(string|array $userId, Fact
|
||||
$mainQuery->where('rank', '<=', function (\Illuminate\Database\Query\Builder $whereQuery) use ($userId, $query) {
|
||||
$whereQuery->where('user_id', $userId);
|
||||
$whereQuery->fromSub($query, 'c');
|
||||
$whereQuery->selectRaw('(c.rank + 1)');
|
||||
|
||||
$whereQuery->selectRaw('(c.rank + (CASE c.rank WHEN 1 THEN 4 WHEN 2 THEN 3 WHEN 3 THEN 2 ELSE 1 END))');
|
||||
});
|
||||
}
|
||||
$mainQuery->orderByDesc('rank');
|
||||
|
||||
Reference in New Issue
Block a user