This commit is contained in:
salam committed 2026-09-23 11:50:01 +02:00
1 parent dc2e6b0fd3
commit 4cdec4be8e
3 files changed
+34 -24

No files matched your search

+24 -18
View File
@@ -17,7 +17,6 @@ class LoadEvents
$team_id = (int) $filter['team_id'] ?? 0;
$statistic_type = $filter['statistic_type'] ?? 'gls';
$team_position = $filter['team_position'];
$seasonmode = $filter['seasonmode'];
$accuracy = (float) $filter['accuracy'] ?? 0.5;
$similar_past_matches = $filter['similar_past_matches'];
@@ -44,8 +43,6 @@ class LoadEvents
$match = StatisticFixtures::with('home')->with('away')->where('id', (int) $match_id)->first();
// dd($match);
if (! $match) {
return [];
}
@@ -98,6 +95,12 @@ class LoadEvents
$expectations = LoadExpectations::load($res['all'], $match, $statistic_type);
// dd($expectations);
$label1 = '';
$label2 = '';
$label3 = '';
$label4 = '';
if ($team_id) {
foreach ($res[$team_position] as $value) {
@@ -255,22 +258,24 @@ class LoadEvents
break;
}
if ($team_id == $value['home_id']) {
$dataset_home[] = (int) $value['val_home'];
$dataset_away[] = (int) $value['val_away'];
} elseif ($team_id == $value['away_id']) {
$dataset_home[] = (int) $value['val_away'];
$dataset_away[] = (int) $value['val_home'];
if ($team_id) {
if ($team_id == $value['home_id']) {
$dataset_home[] = (int) $value['val_home'];
$dataset_away[] = (int) $value['val_away'];
} elseif ($team_id == $value['away_id']) {
$dataset_home[] = (int) $value['val_away'];
$dataset_away[] = (int) $value['val_home'];
}
} else {
if ($match->home_id == $value['home_id']) {
$dataset_home[] = (int) $value['val_home'];
$dataset_away[] = (int) $value['val_away'];
} else {
$dataset_home[] = (int) $value['val_away'];
$dataset_away[] = (int) $value['val_home'];
}
}
// Home playing HOME done and commited
// if ($match->home_id == $value['home_id']) {
// $dataset_home[] = (int) $value['val_home'];
// $dataset_away[] = (int) $value['val_away'];
// } else {
// $dataset_home[] = (int) $value['val_away'];
// $dataset_away[] = (int) $value['val_home'];
// }
// Home playing AWAY done and commited
if ($match->away_id == $value['home_id']) {
$dataset_home2[] = (int) $value['val_home'];
@@ -279,6 +284,7 @@ class LoadEvents
$dataset_home2[] = (int) $value['val_away'];
$dataset_away2[] = (int) $value['val_home'];
}
}
$n = max(count($dataset_home), count($dataset_away), count($dataset_away2), count($dataset_home2));
if ($n) {
@@ -366,7 +372,7 @@ class LoadEvents
];
}
if (isset($dataset_home2) && isset($dataset_away2)) {
if ($label3 && $label4 && isset($dataset_home2) && isset($dataset_away2)) {
$data['datasets'][] = [
'label' => $label3,
'events' => $events,