forked from MarseyWorld/MarseyWorld
dfs
parent
7f06386cc3
commit
cdac52ca8d
|
@ -324,37 +324,37 @@ def leaderboard(v):
|
||||||
sq = g.db.query(User.id, func.rank().over(order_by=User.coins.desc()).label("rank")).subquery()
|
sq = g.db.query(User.id, func.rank().over(order_by=User.coins.desc()).label("rank")).subquery()
|
||||||
pos1 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
pos1 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||||
|
|
||||||
users2 = users.order_by(User.stored_subscriber_count.desc()).all()
|
users2 = users.order_by(User.stored_subscriber_count.desc()).limit(25).all()
|
||||||
pos2 = users2.index(v)
|
sq = g.db.query(User.id, func.rank().over(order_by=User.stored_subscriber_count.desc()).label("rank")).subquery()
|
||||||
users2 = users2[:25]
|
pos2 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||||
|
|
||||||
users3 = users.order_by(User.post_count.desc()).all()
|
users3 = users.order_by(User.post_count.desc()).limit(25).all()
|
||||||
pos3 = users3.index(v)
|
sq = g.db.query(User.id, func.rank().over(order_by=User.post_count.desc()).label("rank")).subquery()
|
||||||
users3 = users3[:25]
|
pos3 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||||
|
|
||||||
users4 = users.order_by(User.comment_count.desc()).all()
|
users4 = users.order_by(User.comment_count.desc()).limit(25).all()
|
||||||
pos4 = users4.index(v)
|
sq = g.db.query(User.id, func.rank().over(order_by=User.comment_count.desc()).label("rank")).subquery()
|
||||||
users4 = users4[:25]
|
pos4 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||||
|
|
||||||
users5 = users.order_by(User.received_award_count.desc()).all()
|
users5 = users.order_by(User.received_award_count.desc()).limit(25).all()
|
||||||
pos5 = users5.index(v)
|
sq = g.db.query(User.id, func.rank().over(order_by=User.received_award_count.desc()).label("rank")).subquery()
|
||||||
users5 = users5[:25]
|
pos5 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||||
|
|
||||||
if request.host == 'pcmemes.net':
|
if request.host == 'pcmemes.net':
|
||||||
users6 = users.order_by(User.basedcount.desc()).all()
|
users6 = users.order_by(User.basedcount.desc()).limit(25).all()
|
||||||
pos6 = users6.index(v)
|
sq = g.db.query(User.id, func.rank().over(order_by=User.basedcount.desc()).label("rank")).subquery()
|
||||||
users6 = users6[:25]
|
pos6 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||||
else:
|
else:
|
||||||
users6 = None
|
users6 = None
|
||||||
pos6 = None
|
pos6 = None
|
||||||
|
|
||||||
users7 = users.order_by(User.coins_spent.desc()).all()
|
users7 = users.order_by(User.coins_spent.desc()).limit(25).all()
|
||||||
pos7 = users7.index(v)
|
sq = g.db.query(User.id, func.rank().over(order_by=User.coins_spent.desc()).label("rank")).subquery()
|
||||||
users7 = users7[:25]
|
pos7 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||||
|
|
||||||
users10 = users.order_by(User.truecoins.desc()).all()
|
users10 = users.order_by(User.truecoins.desc()).limit(25).all()
|
||||||
pos10 = users10.index(v)
|
sq = g.db.query(User.id, func.rank().over(order_by=User.truecoins.desc()).label("rank")).subquery()
|
||||||
users10 = users10[:25]
|
pos10 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||||
|
|
||||||
return render_template("leaderboard.html", v=v, users1=users1, pos1=pos1, users2=users2, pos2=pos2, users3=users3, pos3=pos3, users4=users4, pos4=pos4, users5=users5, pos5=pos5, users6=users6, pos6=pos6, users7=users7, pos7=pos7, users9=users9, users10=users10, pos10=pos10, users12=users12, users13=users13, users15=users15)
|
return render_template("leaderboard.html", v=v, users1=users1, pos1=pos1, users2=users2, pos2=pos2, users3=users3, pos3=pos3, users4=users4, pos4=pos4, users5=users5, pos5=pos5, users6=users6, pos6=pos6, users7=users7, pos7=pos7, users9=users9, users10=users10, pos10=pos10, users12=users12, users13=users13, users15=users15)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue