From 00dd86ee19cf464c4cf4ea714f8e2efdd3f23734 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 17 Jun 2010 12:57:31 +0800 Subject: [PATCH] Fix sessionStats query to exclude tourney hands. --- pyfpdb/SQL.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index ad8ea025..24dee18e 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2632,25 +2632,6 @@ class Sql: GROUP BY h.handStart, hp.handId, hp.sawShowdown, hp.totalProfit ORDER BY h.handStart""" - #################################### - # Session stats query - #################################### - if db_server == 'mysql': - self.query['sessionStats'] = """ - SELECT UNIX_TIMESTAMP(h.handStart) as time, hp.handId, hp.startCash, hp.winnings, hp.totalProfit - FROM HandsPlayers hp - INNER JOIN Players pl ON (pl.id = hp.playerId) - INNER JOIN Hands h ON (h.id = hp.handId) - INNER JOIN Gametypes gt ON (gt.id = h.gametypeId) - WHERE pl.id in - AND pl.siteId in - AND h.handStart > '' - AND h.handStart < '' - - AND hp.tourneysPlayersId IS NULL - GROUP BY h.handStart, hp.handId, hp.totalProfit - ORDER BY h.handStart""" - #################################### # Session stats query #################################### @@ -2664,6 +2645,7 @@ class Sql: INNER JOIN Players p on (p.Id = hp.playerId) WHERE hp.playerId in AND date_format(h.handStart, '%Y-%m-%d') + AND hp.tourneysPlayersId IS NULL ORDER by time""" elif db_server == 'postgresql': self.query['sessionStats'] = """ @@ -2675,6 +2657,7 @@ class Sql: INNER JOIN Players p on (p.Id = hp.playerId) WHERE hp.playerId in AND h.handStart + AND hp.tourneysPlayersId IS NULL ORDER by time""" elif db_server == 'sqlite': self.query['sessionStats'] = """ @@ -2686,6 +2669,7 @@ class Sql: INNER JOIN Players p on (p.Id = hp.playerId) WHERE hp.playerId in AND h.handStart + AND hp.tourneysPlayersId IS NULL ORDER by time"""