wip
This commit is contained in:
1 parent
49e883e49e
commit
41d91a7124
5 files changed
+231
-127
No files matched your search
@@ -76,10 +76,8 @@ class LoadEvents
|
||||
/**
|
||||
* STATTISTIC DATA
|
||||
*/
|
||||
|
||||
$res = LoadEventsQuery::load($filter, $handicap_range, $total_range, $match);
|
||||
|
||||
|
||||
$dataset_home = [];
|
||||
$dataset_away = [];
|
||||
$dataset_exp_home = [];
|
||||
@@ -107,7 +105,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'];
|
||||
@@ -206,7 +204,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;
|
||||
@@ -232,10 +230,10 @@ class LoadEvents
|
||||
$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 = [];
|
||||
|
||||
@@ -257,14 +255,22 @@ class LoadEvents
|
||||
break;
|
||||
}
|
||||
|
||||
// Home playing HOME done and commited
|
||||
if ($match->home_id == $value['home_id']) {
|
||||
if ($team_id == $value['home_id']) {
|
||||
$dataset_home[] = (int) $value['val_home'];
|
||||
$dataset_away[] = (int) $value['val_away'];
|
||||
} else {
|
||||
} elseif ($team_id == $value['away_id']) {
|
||||
$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'];
|
||||
@@ -285,11 +291,13 @@ class LoadEvents
|
||||
}
|
||||
}
|
||||
|
||||
// dd($events, array_sum($dataset_home));
|
||||
// dd($events, array_sum($dataset_home), array_sum($dataset_away));
|
||||
// dd($events, count($dataset_home), count($dataset_away), count($dataset_home2), count($dataset_away2));
|
||||
|
||||
self::shortenEnding($labels, $dataset_home, $dataset_away);
|
||||
|
||||
// dd($dataset_home);
|
||||
|
||||
$data = [
|
||||
'datasets' => [
|
||||
[
|
||||
@@ -333,7 +341,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,
|
||||
@@ -345,7 +353,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,
|
||||
|
||||
Reference in new issue
Block a user