wip
This commit is contained in:
1 parent
4cdec4be8e
commit
b74c374586
3 files changed
+13
-13
No files matched your search
@@ -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'];
|
||||
|
||||
@@ -43,6 +44,8 @@ class LoadEvents
|
||||
|
||||
$match = StatisticFixtures::with('home')->with('away')->where('id', (int) $match_id)->first();
|
||||
|
||||
// dd($match);
|
||||
|
||||
if (! $match) {
|
||||
return [];
|
||||
}
|
||||
@@ -94,13 +97,10 @@ 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) {
|
||||
|
||||
@@ -240,6 +240,9 @@ class LoadEvents
|
||||
$dataset_home2 = [];
|
||||
$dataset_away2 = [];
|
||||
|
||||
$home_id = $match->home_id;
|
||||
$away_id = $match->away_id;
|
||||
|
||||
foreach ($res[$team_position] as $value) {
|
||||
|
||||
$labels[] = round($value['starttime']->diffInDays(Carbon::now()));
|
||||
@@ -267,13 +270,8 @@ class LoadEvents
|
||||
$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'];
|
||||
}
|
||||
$dataset_home[] = (int) $value['val_home'];
|
||||
$dataset_away[] = (int) $value['val_away'];
|
||||
}
|
||||
|
||||
// Home playing AWAY done and commited
|
||||
@@ -284,7 +282,6 @@ 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) {
|
||||
@@ -372,7 +369,7 @@ class LoadEvents
|
||||
];
|
||||
}
|
||||
|
||||
if ($label3 && $label4 && isset($dataset_home2) && isset($dataset_away2)) {
|
||||
if (isset($dataset_home2) && isset($dataset_away2)) {
|
||||
$data['datasets'][] = [
|
||||
'label' => $label3,
|
||||
'events' => $events,
|
||||
|
||||
Reference in new issue
Block a user