Fix GuiSessionStats.py for sqlite

Fix based on solution from Eleatic Stranger on 2+2
This commit is contained in:
Worros 2009-11-02 17:23:50 +08:00
parent f4aa5f1fe1
commit 28ca49d592
2 changed files with 13 additions and 1 deletions

View File

@ -248,6 +248,8 @@ class GuiSessionViewer (threading.Thread):
nametest = nametest.replace("L", "") nametest = nametest.replace("L", "")
nametest = nametest.replace(",)",")") nametest = nametest.replace(",)",")")
q = q.replace("<player_test>", nametest) q = q.replace("<player_test>", nametest)
q = q.replace("<ampersand_s>", "%s")
self.db.cursor.execute(q) self.db.cursor.execute(q)
THRESHOLD = 1800 THRESHOLD = 1800
hands = self.db.cursor.fetchall() hands = self.db.cursor.fetchall()

View File

@ -2502,7 +2502,17 @@ class Sql:
AND h.handStart <datestest> AND h.handStart <datestest>
ORDER by time""" ORDER by time"""
elif db_server == 'sqlite': elif db_server == 'sqlite':
self.query['sessionStats'] = """ """ self.query['sessionStats'] = """
SELECT STRFTIME('<ampersand_s>', h.handStart) as time, hp.handId, hp.startCash, hp.winnings, hp.totalProfit
FROM HandsPlayers hp
INNER JOIN Hands h on (h.id = hp.handId)
INNER JOIN Gametypes gt on (gt.Id = h.gameTypeId)
INNER JOIN Sites s on (s.Id = gt.siteId)
INNER JOIN Players p on (p.Id = hp.playerId)
WHERE hp.playerId in <player_test>
AND h.handStart <datestest>
ORDER by time"""
#################################### ####################################
# Queries to rebuild/modify hudcache # Queries to rebuild/modify hudcache