From 566d03096a1d973e7578d3690562840e6c445685 Mon Sep 17 00:00:00 2001 From: Marek Baczynski Date: Fri, 30 Nov 2018 21:58:38 +0100 Subject: [PATCH] better scoreboard --- kukv1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kukv1.py b/kukv1.py index f509346..9b16870 100644 --- a/kukv1.py +++ b/kukv1.py @@ -28,7 +28,7 @@ def connect(user, password, db, host='localhost', port=5432): return con, meta def getLeaderboard(): - s = 'select u.username as name, u.score as score, max(m.meal_date) as last_meal from users as u inner join meals as m on u.id = m.kuk where m.kuk>0 and m.status>0 group by u.id order by u.score, last_meal;' + s = 'select u.username as name, u.score as score, max(m.meal_date) as last_meal from users as u left join meals as m on m.kuk = u.id group by u.id order by score, last_meal;' r = db_engine.execute(text(s)) leaders=[] for row in r: