forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-02-18 21:18:10 +02:00
parent 919123d009
commit 8ff1acffef
2 changed files with 3 additions and 2 deletions

View File

@ -359,6 +359,7 @@ 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")).group_by(Badge.user_id).order_by(func.count(Badge.user_id).desc()).subquery()
users11 = g.db.query(User, sq.c.count).join(sq, User.id==sq.c.user_id).order_by(sq.c.count.desc())
pos11 = g.db.query(User.id, 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_or_none()
print(pos11)
if pos11: pos11 = (pos11[1],pos11[2])
else: pos11 = (users11.count()+1, 0)
users11 = users11.limit(25).all()

View File

@ -419,7 +419,7 @@
</table>
{% endif %}
<h5 style="font-weight:bold;text-align: center">Top 25 by Winnings</h5>
<h5 style="font-weight:bold;text-align: center">Top 25 by winnings</h5>
<pre></pre>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
@ -450,7 +450,7 @@
</pre>
<h5 style="font-weight:bold;text-align: center">Bottom 25 by Winnings</h5>
<h5 style="font-weight:bold;text-align: center">Bottom 25 by winnings</h5>
<pre></pre>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">