forked from rDrama/rDrama
dfs
parent
cbbdac776f
commit
a8eadb6f63
|
@ -360,8 +360,8 @@ def leaderboard(v):
|
||||||
pos10 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
pos10 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||||
|
|
||||||
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")).group_by(Badge.user_id).subquery()
|
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")).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()
|
users11 = g.db.query(User, sq.c.count).join(sq, User.id==sq.c.user_id).order_by(sq.c.count).limit(25).all()
|
||||||
pos11 = g.db.query(User, sq.c.rank, sq.c.count).join(sq, User.id==sq.c.user_id).filter(User.id == v.id).order_by(sq.c.count.desc()).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])
|
pos11 = (pos11[1],pos11[2])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue