This commit is contained in:
salam committed 2026-10-14 17:37:07 +02:00
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;
}