From 33760fae9c94421004b02097e443e42e3467eb09 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sun, 11 Jul 2010 05:11:43 +0200 Subject: [PATCH] TPS displays ITM% --- pyfpdb/GuiTourneyPlayerStats.py | 2 +- pyfpdb/SQL.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyfpdb/GuiTourneyPlayerStats.py b/pyfpdb/GuiTourneyPlayerStats.py index 90a7ecff..ab654b79 100644 --- a/pyfpdb/GuiTourneyPlayerStats.py +++ b/pyfpdb/GuiTourneyPlayerStats.py @@ -80,11 +80,11 @@ class GuiTourneyPlayerStats (threading.Thread): , ["buyIn", True, "BuyIn", 1.0, "%3.2f", "str"] , ["playerName", False, "Name", 0.0, "%s", "str"] # true not allowed for this line (set in code) , ["tourneyCount", True, "#", 1.0, "%1.0f", "str"] + , ["itm", True, "ITM%", 1.0, "%3.2f", "str"] , ["1st", False, "1st", 1.0, "%1.0f", "str"] , ["2nd", True, "2nd", 1.0, "%1.0f", "str"] , ["3rd", True, "3rd", 1.0, "%1.0f", "str"] , ["unknownRank", True, "unknown", 1.0, "%1.0f", "str"] - #, ["itm", True, "ITM", 1.0, "%2.2f", "str"] #, ["roi", True, "ROI", 1.0, "%3.1f", "str"] , ["invested", True, "Invested", 1.0, "%3.2f", "str"] , ["profit", True, "Profit", 1.0, "%3.2f", "str"]] diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index a8784544..2d27ee45 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -2264,10 +2264,11 @@ class Sql: ,(CASE WHEN tt.currency = "USD" THEN tt.buyIn/100.0 ELSE tt.buyIn END) AS buyIn ,p.name AS playerName ,COUNT(1) AS tourneyCount + ,SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END) AS unknownRank + ,SUM(CASE WHEN winnings > 0 THEN 1 ELSE 0 END)/(COUNT(1) - SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END)) AS itm ,SUM(CASE WHEN rank = 1 THEN 1 ELSE 0 END) AS 1st ,SUM(CASE WHEN rank = 2 THEN 1 ELSE 0 END) AS 2nd ,SUM(CASE WHEN rank = 3 THEN 1 ELSE 0 END) AS 3rd - ,SUM(CASE WHEN tp.rank > 0 THEN 0 ELSE 1 END) AS unknownRank ,SUM(tp.winnings)/100.0 AS profit ,SUM(tt.buyin+tt.fee)/100.0 AS invested from TourneysPlayers tp