mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 07:01:36 +01:00
align db query with displayed rating
This commit is contained in:
@@ -50,8 +50,8 @@ def findPlayerByName(database, playerName):
|
|||||||
|
|
||||||
playerInLeaderboard = player.PlayerInLeaderboard(playerRow)
|
playerInLeaderboard = player.PlayerInLeaderboard(playerRow)
|
||||||
# compte rank
|
# compte rank
|
||||||
cursor.execute("SELECT COUNT(*) from players where mu < ( SELECT mu from players where playerId == ? );",
|
cursor.execute("SELECT COUNT(*) from players where (mu-2*sigma) > (?-2*?);",
|
||||||
(playerInLeaderboard.playerId,))
|
(playerInLeaderboard.mu, playerInLeaderboard.sigma))
|
||||||
rank = cursor.fetchone()[0]
|
rank = cursor.fetchone()[0]
|
||||||
conn.close()
|
conn.close()
|
||||||
return (playerInLeaderboard, rank)
|
return (playerInLeaderboard, rank)
|
||||||
|
|||||||
Reference in New Issue
Block a user