TPS displays profit/tourney

This commit is contained in:
steffen123 2010-07-11 05:35:41 +02:00
parent 7bf7463705
commit 6038342de7
2 changed files with 4 additions and 2 deletions

View File

@ -89,7 +89,8 @@ class GuiTourneyPlayerStats (threading.Thread):
, ["unknownRank", True, "Rank?", 1.0, "%1.0f", "str"] , ["unknownRank", True, "Rank?", 1.0, "%1.0f", "str"]
, ["spent", True, "Spent", 1.0, "%3.2f", "str"] , ["spent", True, "Spent", 1.0, "%3.2f", "str"]
, ["won", True, "Won", 1.0, "%3.2f", "str"] , ["won", True, "Won", 1.0, "%3.2f", "str"]
, ["roi", True, "ROI%", 1.0, "%3.0f", "str"]] , ["roi", True, "ROI%", 1.0, "%3.0f", "str"]
, ["profitPerTourney", True,"$/Tour", 1.0, "%3.2f", "str"]]
self.stats_frame = gtk.Frame() self.stats_frame = gtk.Frame()
self.stats_frame.show() self.stats_frame.show()

View File

@ -2274,6 +2274,7 @@ class Sql:
,SUM(tp.winnings)/100.0 AS won ,SUM(tp.winnings)/100.0 AS won
,SUM(tt.buyin+tt.fee)/100.0 AS spent ,SUM(tt.buyin+tt.fee)/100.0 AS spent
,SUM(tp.winnings)/SUM(tt.buyin+tt.fee)*100.0-100 AS roi ,SUM(tp.winnings)/SUM(tt.buyin+tt.fee)*100.0-100 AS roi
,SUM(tp.winnings-(tt.buyin+tt.fee))/100.0/(COUNT(1)-SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END)) AS profitPerTourney
from TourneysPlayers tp from TourneysPlayers tp
inner join Tourneys t on (t.id = tp.tourneyId) inner join Tourneys t on (t.id = tp.tourneyId)
inner join TourneyTypes tt on (tt.Id = t.tourneyTypeId) inner join TourneyTypes tt on (tt.Id = t.tourneyTypeId)