summaryrefslogtreecommitdiff
path: root/Aktywator
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-10-17 14:33:07 +0200
committeremkael <emkael@tlen.pl>2017-10-17 14:33:07 +0200
commitcf23b76ef751912304c593443832d1410574119a (patch)
tree65ccd523651a67c6bb1ae3314989fa5b88fc344f /Aktywator
parent45550ac5edd1967c3cbaf8a2c396e6a8bc83ca05 (diff)
Including match carry-over in displayed IMP results
Diffstat (limited to 'Aktywator')
-rw-r--r--Aktywator/Resources/BuildDate.txt2
-rw-r--r--Aktywator/TeamNamesSettings.cs9
2 files changed, 9 insertions, 2 deletions
diff --git a/Aktywator/Resources/BuildDate.txt b/Aktywator/Resources/BuildDate.txt
index 5f59e05..19d5ac5 100644
--- a/Aktywator/Resources/BuildDate.txt
+++ b/Aktywator/Resources/BuildDate.txt
@@ -1 +1 @@
-2017-09-30
+2017-10-17
diff --git a/Aktywator/TeamNamesSettings.cs b/Aktywator/TeamNamesSettings.cs
index 82edee2..034e362 100644
--- a/Aktywator/TeamNamesSettings.cs
+++ b/Aktywator/TeamNamesSettings.cs
@@ -85,10 +85,17 @@ namespace Aktywator
ret.Append("' ' FROM teams ORDER BY teams.id");
break;
case 1:
- ret.Append("CONCAT(SUM(IF(segments.homet = teams.id, impH+corrH, impV+corrV)), ' IMP') FROM teams LEFT JOIN segments ON (teams.id = segments.homet OR teams.id = segments.visit) AND segments.rnd = ");
+ ret.Append("CONCAT(");
+ ret.Append("SUM(IF(segments.homet = teams.id, segments.impH+segments.corrH, segments.impV+segments.corrV))");
+ ret.Append(" + IF(matches.homet = teams.id AND matches.carry > 0, matches.carry, 0)");
+ ret.Append("+ IF(matches.visit = teams.id AND matches.carry < 0, -matches.carry, 0),");
+ ret.Append("' IMP')");
+ ret.Append("FROM teams LEFT JOIN segments ON (teams.id = segments.homet OR teams.id = segments.visit) AND segments.rnd = ");
ret.Append(cbRounds.SelectedItem);
ret.Append(" AND segments.segment < ");
ret.Append(cbSegments.SelectedItem);
+ ret.Append(" LEFT JOIN matches ON (teams.id = matches.homet OR teams.id = matches.visit) AND matches.rnd = ");
+ ret.Append(cbRounds.SelectedItem);
ret.Append(" GROUP BY teams.id ORDER BY teams.id");
break;
case 2: