wip
This commit is contained in:
1 parent
e09e42ab41
commit
fc1e1b2832
6 files changed
+200
-115
No files matched your search
@@ -10,7 +10,8 @@ class Expectation1X2
|
||||
public static function load(array &$expectations, array $filter, object $match)
|
||||
{
|
||||
$team_id = (int) $filter['team_id'] ?? 0;
|
||||
$team_position = $filter['team_position'];
|
||||
$home_id = $match->home_id;
|
||||
$away_id = $match->away_id;
|
||||
|
||||
$res_tp = LoadEventsQueryTP::load($filter, $match);
|
||||
|
||||
@@ -19,7 +20,7 @@ class Expectation1X2
|
||||
|
||||
$expectations += ['win_count' => 0, 'draw_count' => 0, 'lost_count' => 0];
|
||||
foreach ($res_tp as $value) {
|
||||
if ($team_id && $team_position == 'home') {
|
||||
if ($value->home_id == $team_id) {
|
||||
switch ($value['result_code']) {
|
||||
case '1':
|
||||
$expectations['win_count']++;
|
||||
@@ -31,15 +32,15 @@ class Expectation1X2
|
||||
$expectations['lost_count']++;
|
||||
break;
|
||||
}
|
||||
} elseif ($team_id && $team_position == 'away') {
|
||||
} elseif ($value->away_id == $team_id) {
|
||||
switch ($value['result_code']) {
|
||||
case '1':
|
||||
case '2':
|
||||
$expectations['win_count']++;
|
||||
break;
|
||||
case 'X':
|
||||
$expectations['draw_count']++;
|
||||
break;
|
||||
case '2':
|
||||
case '1':
|
||||
$expectations['lost_count']++;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user