wip
This commit is contained in:
1 parent
fbaadcd248
commit
b4379efb82
9 files changed
+110
-13
No files matched your search
@@ -31,14 +31,17 @@ class LoadEvents
|
||||
|
||||
$statistic_type = $filter['statistic_type'] ?? 0;
|
||||
|
||||
$team_position = $filter['team_position'];
|
||||
|
||||
if (! $league_id) {
|
||||
return [];
|
||||
}
|
||||
if (! $team_id) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$team_position = $filter['team_position'];
|
||||
if (! $statistic_type) {
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* STATTISTIC DATA
|
||||
@@ -60,7 +63,7 @@ class LoadEvents
|
||||
})->when($end, function ($query) use ($end) {
|
||||
return $query->where('starttime', '<=', $end);
|
||||
})
|
||||
->orderBy('starttime')
|
||||
->orderBy('starttime', 'ASC')
|
||||
->get();
|
||||
|
||||
// dd($res);
|
||||
@@ -71,12 +74,10 @@ class LoadEvents
|
||||
|
||||
$datasets = [];
|
||||
$labels = [];
|
||||
|
||||
if (! $statistic_type || $statistic_type == 'none') {
|
||||
$statistic_type = 'gls';
|
||||
}
|
||||
$labels_since = [];
|
||||
|
||||
foreach ($res as $value) {
|
||||
|
||||
$labels[] = $value['starttime']->format('d.M.y');
|
||||
|
||||
if ($team_position == 'home') {
|
||||
@@ -189,11 +190,15 @@ class LoadEvents
|
||||
$data = [
|
||||
'datasets' => [
|
||||
[
|
||||
'label' => ucfirst($team_position),
|
||||
'label' => HelperStatisticType::get($filter),
|
||||
'data' => $datasets,
|
||||
'fill' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#36A2EB',
|
||||
'datalabels' => [
|
||||
'align' => 'start',
|
||||
'anchor' => 'start',
|
||||
],
|
||||
],
|
||||
],
|
||||
'labels' => $labels,
|
||||
|
||||
Reference in new issue
Block a user