fix(user): wrong order for best & recent scores

This commit is contained in:
MingxuanGame
2025-08-11 09:55:15 +00:00
parent 2f54ac262c
commit ee9381d1f0
2 changed files with 2 additions and 0 deletions

View File

View File

@@ -164,8 +164,10 @@ async def get_user_scores(
order_by = col(Score.pinned_order).asc()
elif type == "best":
where_clause &= exists().where(col(PPBestScore.score_id) == Score.id)
order_by = col(Score.pp).desc()
elif type == "recent":
where_clause &= Score.ended_at > datetime.now(UTC) - timedelta(hours=24)
order_by = col(Score.ended_at).desc()
elif type == "firsts":
# TODO
where_clause &= false()