fix: show only best score for each player
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 34s
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 34s
This commit is contained in:
parent
8e33400516
commit
219d590e71
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ export const GET: RequestHandler = async ({ url, platform }) => {
|
|||
|
||||
const { results } = await db
|
||||
.prepare(
|
||||
"SELECT game.id, game.total_score, user.name FROM game INNER JOIN user ON user.id = game.user_id WHERE game.mode = ? AND game.stops_type = ? ORDER BY game.total_score DESC, game.time ASC LIMIT 10",
|
||||
"SELECT game.id, max(game.total_score) AS total_score, user.name FROM game INNER JOIN user ON user.id = game.user_id WHERE game.mode = ? AND game.stops_type = ? GROUP BY game.user_id ORDER BY game.total_score DESC, game.time ASC LIMIT 10",
|
||||
)
|
||||
.bind(options.mode, options.stopsType)
|
||||
.all();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue