wip fix error box 3

This commit is contained in:
salam committed 2026-10-12 21:51:50 +02:00
1 parent 2728944c39
commit e52722d3e1
9 files changed
+455 -119

No files matched your search

+22 -4
View File
@@ -13,6 +13,15 @@ class LoadEventsBoxes
$team_id = (int) $filter['team_id'] ?? 0;
$similar_past_matches = $filter['similar_past_matches'];
$match = StatisticFixtures::with('home')->with('away')->where('id', (int) $match_id)->first();
if ($similar_past_matches != 'none') {
$home_team = $match->home->ss_team_name;
$away_team = $match->away->ss_team_name;
} else {
$home_team = 'In Favour';
$away_team = 'Against';
}
if (! $league_id) {
return [];
}
@@ -20,15 +29,24 @@ class LoadEventsBoxes
return [];
}
$match = StatisticFixtures::with('home')->with('away')->where('id', (int) $match_id)->first();
if (! $match) {
return [];
}
$expectations = self::template();
$expectations = [];
$expectations['gls']['name'] = 'Goals';
$expectations['crn']['name'] = 'Corner';
$expectations['fls']['name'] = 'Fouls';
$expectations['ofs']['name'] = 'Offsides';
$expectations['crd']['name'] = 'Cards';
$expectations['snt']['name'] = 'Shots on Target';
$expectations['tsh']['name'] = 'Total Shots';
$expectations['home'] = $home_team;
$expectations['away'] = $away_team;
ExpectationsTeam::load($expectations, $filter, $match);
Expectation1X2::load($expectations, $filter, $match);
ExpectationsTeamNew::load($expectations, $filter, $match);
if ($team_id == $match->home_id) {
$expectations['active_team'] = $match->home->ss_team_name;