Fix sessionStats query to exclude tourney hands.

This commit is contained in:
Worros 2010-06-17 12:57:31 +08:00
parent 61e3f79a7f
commit 00dd86ee19

View File

@ -2632,25 +2632,6 @@ class Sql:
GROUP BY h.handStart, hp.handId, hp.sawShowdown, hp.totalProfit GROUP BY h.handStart, hp.handId, hp.sawShowdown, hp.totalProfit
ORDER BY h.handStart""" 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 <player_test>
AND pl.siteId in <site_test>
AND h.handStart > '<startdate_test>'
AND h.handStart < '<enddate_test>'
<limit_test>
AND hp.tourneysPlayersId IS NULL
GROUP BY h.handStart, hp.handId, hp.totalProfit
ORDER BY h.handStart"""
#################################### ####################################
# Session stats query # Session stats query
#################################### ####################################
@ -2664,6 +2645,7 @@ class Sql:
INNER JOIN Players p on (p.Id = hp.playerId) INNER JOIN Players p on (p.Id = hp.playerId)
WHERE hp.playerId in <player_test> WHERE hp.playerId in <player_test>
AND date_format(h.handStart, '%Y-%m-%d') <datestest> AND date_format(h.handStart, '%Y-%m-%d') <datestest>
AND hp.tourneysPlayersId IS NULL
ORDER by time""" ORDER by time"""
elif db_server == 'postgresql': elif db_server == 'postgresql':
self.query['sessionStats'] = """ self.query['sessionStats'] = """
@ -2675,6 +2657,7 @@ class Sql:
INNER JOIN Players p on (p.Id = hp.playerId) INNER JOIN Players p on (p.Id = hp.playerId)
WHERE hp.playerId in <player_test> WHERE hp.playerId in <player_test>
AND h.handStart <datestest> AND h.handStart <datestest>
AND hp.tourneysPlayersId IS NULL
ORDER by time""" ORDER by time"""
elif db_server == 'sqlite': elif db_server == 'sqlite':
self.query['sessionStats'] = """ self.query['sessionStats'] = """
@ -2686,6 +2669,7 @@ class Sql:
INNER JOIN Players p on (p.Id = hp.playerId) INNER JOIN Players p on (p.Id = hp.playerId)
WHERE hp.playerId in <player_test> WHERE hp.playerId in <player_test>
AND h.handStart <datestest> AND h.handStart <datestest>
AND hp.tourneysPlayersId IS NULL
ORDER by time""" ORDER by time"""