Aevann 2024-08-05 22:27:14 +03:00
parent 74dccdf424
commit 4bbf6f8b1a
1 changed files with 4 additions and 4 deletions

View File

@ -36,16 +36,16 @@ def get_game_leaderboard(game):
timestamp_all_time = CASINO_RELEASE_DAY # "All Time" starts on release day
biggest_win_all_time = g.db.query(CasinoGame.user_id, User.username, CasinoGame.currency, CasinoGame.winnings).select_from(
CasinoGame).join(User).order_by(CasinoGame.winnings.desc()).filter(CasinoGame.kind == game, CasinoGame.created_utc > timestamp_all_time).limit(1).one_or_none()
CasinoGame).join(User).order_by(CasinoGame.winnings.desc()).filter(CasinoGame.user_id != CARP_ID, CasinoGame.kind == game, CasinoGame.created_utc > timestamp_all_time).limit(1).one_or_none()
biggest_win_last_24h = g.db.query(CasinoGame.user_id, User.username, CasinoGame.currency, CasinoGame.winnings).select_from(
CasinoGame).join(User).order_by(CasinoGame.winnings.desc()).filter(CasinoGame.kind == game, CasinoGame.created_utc > timestamp_24h_ago).limit(1).one_or_none()
CasinoGame).join(User).order_by(CasinoGame.winnings.desc()).filter(CasinoGame.user_id != CARP_ID, CasinoGame.kind == game, CasinoGame.created_utc > timestamp_24h_ago).limit(1).one_or_none()
biggest_loss_all_time = g.db.query(CasinoGame.user_id, User.username, CasinoGame.currency, CasinoGame.winnings).select_from(
CasinoGame).join(User).order_by(CasinoGame.winnings).filter(CasinoGame.kind == game, CasinoGame.created_utc > timestamp_all_time).limit(1).one_or_none()
CasinoGame).join(User).order_by(CasinoGame.winnings).filter(CasinoGame.user_id != CARP_ID, CasinoGame.kind == game, CasinoGame.created_utc > timestamp_all_time).limit(1).one_or_none()
biggest_loss_last_24h = g.db.query(CasinoGame.user_id, User.username, CasinoGame.currency, CasinoGame.winnings).select_from(
CasinoGame).join(User).order_by(CasinoGame.winnings).filter(CasinoGame.kind == game, CasinoGame.created_utc > timestamp_24h_ago).limit(1).one_or_none()
CasinoGame).join(User).order_by(CasinoGame.winnings).filter(CasinoGame.user_id != CARP_ID, CasinoGame.kind == game, CasinoGame.created_utc > timestamp_24h_ago).limit(1).one_or_none()
if not biggest_win_all_time:
biggest_win_all_time = [None, None, None, 0]