fix mysql code for new stats options

This commit is contained in:
sqlcoder 2009-10-19 00:15:11 +01:00
parent 4b7aadd325
commit 35cc1b1314
2 changed files with 7 additions and 4 deletions

View File

@ -427,8 +427,8 @@ class GuiPlayerStats (threading.Thread):
if holecards: # re-use level variables for hole card query if holecards: # re-use level variables for hole card query
query = query.replace("<hgameTypeId>", "hp.startcards") query = query.replace("<hgameTypeId>", "hp.startcards")
query = query.replace("<orderbyhgameTypeId>" query = query.replace("<orderbyhgameTypeId>"
, ",case when hp.startcards/13 >= mod(hp.startcards,13) then hp.startcards + 0.1 " , ",case when floor(hp.startcards/13) >= mod(hp.startcards,13) then hp.startcards + 0.1 "
+ " else 13*mod(hp.startcards,13) + hp.startcards/13 " + " else 13*mod(hp.startcards,13) + floor(hp.startcards/13) "
+ " end desc ") + " end desc ")
else: else:
query = query.replace("<orderbyhgameTypeId>", "") query = query.replace("<orderbyhgameTypeId>", "")

View File

@ -1727,6 +1727,7 @@ class Sql:
if db_server == 'mysql': if db_server == 'mysql':
self.query['playerDetailedStats'] = """ self.query['playerDetailedStats'] = """
select <hgameTypeId> AS hgametypeid select <hgameTypeId> AS hgametypeid
,<playerName> AS pname
,gt.base ,gt.base
,gt.category ,gt.category
,upper(gt.limitType) AS limittype ,upper(gt.limitType) AS limittype
@ -1777,6 +1778,7 @@ class Sql:
inner join Hands h on (h.id = hp.handId) inner join Hands h on (h.id = hp.handId)
inner join Gametypes gt on (gt.Id = h.gameTypeId) inner join Gametypes gt on (gt.Id = h.gameTypeId)
inner join Sites s on (s.Id = gt.siteId) inner join Sites s on (s.Id = gt.siteId)
inner join Players p on (p.Id = hp.playerId)
where hp.playerId in <player_test> where hp.playerId in <player_test>
/*and hp.tourneysPlayersId IS NULL*/ /*and hp.tourneysPlayersId IS NULL*/
and h.seats <seats_test> and h.seats <seats_test>
@ -1784,14 +1786,15 @@ class Sql:
<gtbigBlind_test> <gtbigBlind_test>
and date_format(h.handStart, '%Y-%m-%d') <datestest> and date_format(h.handStart, '%Y-%m-%d') <datestest>
group by hgameTypeId group by hgameTypeId
,hp.playerId ,pname
,gt.base ,gt.base
,gt.category ,gt.category
<groupbyseats> <groupbyseats>
,plposition ,plposition
,upper(gt.limitType) ,upper(gt.limitType)
,s.name ,s.name
order by hp.playerId having 1 = 1 <havingclause>
order by pname
,gt.base ,gt.base
,gt.category ,gt.category
<orderbyseats> <orderbyseats>