master
Aevann1 2022-01-19 12:08:19 +02:00
parent 81b4d603a5
commit 8bfa11b021
1 changed files with 2 additions and 2 deletions

View File

@ -361,8 +361,8 @@ def leaderboard(v):
sq = g.db.query(Badge.user_id, func.count(Badge.user_id).label("count"), func.rank().over(order_by=func.count(Badge.user_id).desc()).label("rank")).order_by(func.count(Badge.user_id).desc()).group_by(Badge.user_id).subquery()
users11 = g.db.query(User, sq.c.count).join(sq, User.id==sq.c.user_id).limit(25).all()
pos11 = g.db.query(sq.c.rank, sq.c.count).join(sq, User.id==sq.c.user_id).filter(User.id == v.id).limit(1).one()
pos11 = g.db.query(User, sq.c.rank, sq.c.count).join(sq, User.id==sq.c.user_id).filter(User.id == v.id).one()
pos11 = (pos11[1],pos11[2])
try:
pos13 = [x[0].id for x in users13].index(v.id)
pos13 = (pos13+1, users13[pos13][1])