fix season

This commit is contained in:
salam committed 2026-08-31 07:03:58 +02:00
1 parent d220e340e2
commit 7e30e93f90
5 files changed
+56 -48

No files matched your search

+14 -11
View File
@@ -17,6 +17,7 @@ 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'];
@@ -52,7 +53,7 @@ class LoadEvents
if ($similar_past_matches != 'none') {
$team_id = 0;
$team_position = '';
$exp_handicap = $match->exp_away - $match->exp_home;
@@ -75,8 +76,10 @@ class LoadEvents
/**
* STATTISTIC DATA
*/
$res = LoadEventsQuery::load($filter, $handicap_range, $total_range, $match);
$dataset_home = [];
$dataset_away = [];
$dataset_exp_home = [];
@@ -104,7 +107,7 @@ class LoadEvents
$playing_date[] = $value['starttime']->format('Y-m-d H:i');
$results_per_event[] = $value['val_home'].' : '.$value['val_away'];
$results_per_event[] = $value['val_home'] . ' : ' . $value['val_away'];
$val_home = (int) $value['val_home'];
$val_away = (int) $value['val_away'];
@@ -203,7 +206,7 @@ class LoadEvents
}
}
if (isset($val_home) && isset($val_away)) {
$events[] = $value['home'].' vs '.$value['away'];
$events[] = $value['home'] . ' vs ' . $value['away'];
if ($team_id == $value['home_id']) {
$dataset_home[] = $val_home;
@@ -223,16 +226,16 @@ class LoadEvents
} else {
if ($team_id == $match->home->ss_team_id) {
$label1 = $match->home->ss_team_name;
}else {
} else {
$label1 = $match->away->ss_team_name;
}
$label2 = 'Opponent';
}
} else {
$label1 = $match->home->ss_team_name.' +';
$label2 = $match->home->ss_team_name.' -';
$label3 = $match->away->ss_team_name.' +';
$label4 = $match->away->ss_team_name.' -';
$label1 = $match->home->ss_team_name . ' +';
$label2 = $match->home->ss_team_name . ' -';
$label3 = $match->away->ss_team_name . ' +';
$label4 = $match->away->ss_team_name . ' -';
$dataset_home2 = [];
$dataset_away2 = [];
@@ -272,7 +275,7 @@ class LoadEvents
}
}
$n = max(count($dataset_home), count($dataset_away), count($dataset_away2), count($dataset_home2));
if($n){
if ($n) {
$f = array_first($labels);
$step = round($f / $n);
$labels = [];
@@ -330,7 +333,7 @@ class LoadEvents
];
if ($team_id && $statistic_type == 'gls') {
$data['datasets'][] = [
'label' => 'Goals '.$label1,
'label' => 'Goals ' . $label1,
'events' => $events,
'playing_date' => $playing_date,
'results_per_event' => $results_per_event,
@@ -342,7 +345,7 @@ class LoadEvents
'hidden' => true,
];
$data['datasets'][] = [
'label' => 'Goals '.$label2,
'label' => 'Goals ' . $label2,
'events' => $events,
'playing_date' => $playing_date,
'results_per_event' => $results_per_event,