Browse Source

räkna rätt matcher

Axel Nordh 4 years ago
parent
commit
4bfa109225
2 changed files with 7 additions and 7 deletions
  1. 2 2
      OddsJavaFx/src/web/matchTable.php
  2. 5 5
      OddsJavaFx/src/web/webDbConnection.php

+ 2 - 2
OddsJavaFx/src/web/matchTable.php

@@ -30,9 +30,9 @@ $betMarginAway = 1 + ($leagueInfo['betMarginAway'] / 100);
             <th>Hemma lag</th>
             <th>Hemma lag</th>
             <th>Borta lag</th>
             <th>Borta lag</th>
             <th>Odds 1</th>
             <th>Odds 1</th>
-            <th>(Odds X)</th>
+            <th>Odds X</th>
             <th>Odds 2</th>
             <th>Odds 2</th>
-        	<th>Bet home (true)/away (false)</th>
+        	<th>1, X , 2</th>
         	<th>Bet Odds</th>
         	<th>Bet Odds</th>
         	<th>Bet Amount</th>
         	<th>Bet Amount</th>
         	<th>&nbsp;</th>
         	<th>&nbsp;</th>

+ 5 - 5
OddsJavaFx/src/web/webDbConnection.php

@@ -96,12 +96,12 @@ class WebDbConnection {
             $awayTeamResultsHome = $this->getTeamResults($match['homeTeam'], $lookbackAway, true)[0];
             $awayTeamResultsHome = $this->getTeamResults($match['homeTeam'], $lookbackAway, true)[0];
             $awayTeamResultsAway = $this->getTeamResults($match['awayTeam'], $lookbackAway, false)[0];
             $awayTeamResultsAway = $this->getTeamResults($match['awayTeam'], $lookbackAway, false)[0];
             
             
-            $homeTeamCount = $homeTeamResults['wins'] + $homeTeamResults['draws'] + $homeTeamResults['lost'];
-            $awayTeamCount = $awayTeamResults['wins'] + $awayTeamResults['draws'] + $awayTeamResults['lost'];
+            $homeTeamCountHome = $homeTeamResultsHome['wins'] + $homeTeamResultsHome['draws'] + $homeTeamResultsHome['lost'];
+            $homeTeamCountAway = $homeTeamResultsAway['wins'] + $homeTeamResultsAway['draws'] + $homeTeamResultsAway['lost'];
             
             
-            $homeWinPercent = round((($homeTeamResultsHome['wins'] + $homeTeamResultsAway['lost']) / ($homeTeamCount + $awayTeamCount)) * 100,2);
-            $drawPercent = round((($drawTeamResultsHome['draws'] + $drawTeamResultsAway['draws']) / ($homeTeamCount + $awayTeamCount)) * 100, 2);
-            $awayWinPercent = round((($awayTeamResultsAway['wins'] + $awayTeamResultsHome['lost']) / ($homeTeamCount + $awayTeamCount)) * 100, 2);
+            $homeWinPercent = round((($homeTeamResultsHome['wins'] + $homeTeamResultsAway['lost']) / ($homeTeamCountHome + $homeTeamCountAway)) * 100,2);
+            $drawPercent = round((($drawTeamResultsHome['draws'] + $drawTeamResultsAway['draws']) / ($homeTeamCountHome + $homeTeamCountAway)) * 100, 2);
+            $awayWinPercent = round((($awayTeamResultsAway['wins'] + $awayTeamResultsHome['lost']) / ($homeTeamCountHome + $homeTeamCountAway)) * 100, 2);
             
             
             $match['homeWinPercent'] = $homeWinPercent;
             $match['homeWinPercent'] = $homeWinPercent;
             $match['drawPercent'] = $drawPercent;
             $match['drawPercent'] = $drawPercent;