wip
This commit is contained in:
1 parent
679038a503
commit
d0e2f32501
2 files changed
+55
-50
No files matched your search
@@ -84,6 +84,28 @@ class Statistic extends BaseDashboard
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Diese Methode liefert das Daten-Array für ALLE Widgets.
|
||||
* Durch 'once()' läuft die Query pro Request exakt 1x.
|
||||
*/
|
||||
// public function getSharedWidgetData(): array
|
||||
// {
|
||||
// return once(function () {
|
||||
// $filters = $this->getFilters();
|
||||
|
||||
// // Ihre MongoDB / Eloquent Query basierend auf den aktuellen Filtern
|
||||
// return Order::query()
|
||||
// ->when($filters['start_date'] ?? null, fn ($q, $date) => $q->where('created_at', '>=', $date))
|
||||
// ->when($filters['status'] ?? null, fn ($q, $status) => $q->where('status', $status))
|
||||
// ->selectRaw('count(*) as total_count, sum(total_price) as total_revenue, avg(total_price) as average_amount')
|
||||
// ->first()
|
||||
// ->toArray();
|
||||
// });
|
||||
// }
|
||||
|
||||
// // Im Widget -> Nutzt exakt dasselbe Array aus dem Speicher
|
||||
// $sharedData = $this->getPage()->getSharedWidgetData();
|
||||
|
||||
public function filtersForm(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
|
||||
@@ -201,6 +201,9 @@ class LoadPerformance
|
||||
$data = [
|
||||
'datasets' => [
|
||||
[
|
||||
/**
|
||||
* HOME
|
||||
*/
|
||||
'label' => $team_map[$match->home_id],
|
||||
'playing_date' => $date_home,
|
||||
'results_per_event' => $results_home,
|
||||
@@ -208,8 +211,8 @@ class LoadPerformance
|
||||
'data' => $homes['all'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#fb2c36',
|
||||
'backgroundColor' => '#fb2c36',
|
||||
'borderColor' => '#2b7fff',
|
||||
'backgroundColor' => '#2b7fff',
|
||||
'pointStyle' => $hasdots,
|
||||
],
|
||||
[
|
||||
@@ -220,8 +223,7 @@ class LoadPerformance
|
||||
'data' => $home_av['all'],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#fb2c36',
|
||||
'backgroundColor' => 'transparent',
|
||||
'borderColor' => '#2b7fff',
|
||||
'pointStyle' => false,
|
||||
'borderDash' => [5, 5],
|
||||
],
|
||||
@@ -233,8 +235,8 @@ class LoadPerformance
|
||||
'data' => $homes['def'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#fe9a00',
|
||||
'backgroundColor' => '#fe9a00',
|
||||
'borderColor' => '#8ec5ff',
|
||||
'backgroundColor' => '#8ec5ff',
|
||||
'fill' => false,
|
||||
'pointStyle' => $hasdots,
|
||||
'hidden' => true,
|
||||
@@ -247,7 +249,7 @@ class LoadPerformance
|
||||
'data' => $home_av['def'],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#fe9a00',
|
||||
'borderColor' => '#8ec5ff',
|
||||
'backgroundColor' => 'transparent',
|
||||
'pointStyle' => false,
|
||||
'hidden' => true,
|
||||
@@ -261,8 +263,8 @@ class LoadPerformance
|
||||
'data' => $homes['att'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#fe9a00',
|
||||
'backgroundColor' => '#fe9a00',
|
||||
'borderColor' => '#8ec5ff',
|
||||
'backgroundColor' => '#8ec5ff',
|
||||
'fill' => false,
|
||||
'pointStyle' => $hasdots,
|
||||
'hidden' => true,
|
||||
@@ -275,7 +277,7 @@ class LoadPerformance
|
||||
'data' => $home_av['att'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#fe9a00',
|
||||
'borderColor' => '#8ec5ff',
|
||||
'backgroundColor' => 'transparent',
|
||||
'fill' => false,
|
||||
'pointStyle' => false,
|
||||
@@ -290,8 +292,8 @@ class LoadPerformance
|
||||
'data' => $homes['mid'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#fe9a00',
|
||||
'backgroundColor' => '#fe9a00',
|
||||
'borderColor' => '#8ec5ff',
|
||||
'backgroundColor' => '#8ec5ff',
|
||||
'fill' => false,
|
||||
'pointStyle' => $hasdots,
|
||||
'hidden' => true,
|
||||
@@ -304,7 +306,7 @@ class LoadPerformance
|
||||
'data' => $home_av['mid'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#fe9a00',
|
||||
'borderColor' => '#8ec5ff',
|
||||
'backgroundColor' => 'transparent',
|
||||
'fill' => false,
|
||||
'pointStyle' => false,
|
||||
@@ -322,8 +324,8 @@ class LoadPerformance
|
||||
'data' => $aways['all'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#00bc7d',
|
||||
'backgroundColor' => '#00bc7d',
|
||||
'borderColor' => '#00c950',
|
||||
'backgroundColor' => '#00c950',
|
||||
'fill' => false,
|
||||
'pointStyle' => $hasdots,
|
||||
'hidden' => false,
|
||||
@@ -336,8 +338,7 @@ class LoadPerformance
|
||||
'data' => $away_av['all'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#00bc7d',
|
||||
'backgroundColor' => 'transparent',
|
||||
'borderColor' => '#00c950',
|
||||
'fill' => false,
|
||||
'pointStyle' => false,
|
||||
'borderDash' => [5, 5],
|
||||
@@ -351,8 +352,8 @@ class LoadPerformance
|
||||
'data' => $aways['def'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#7ccf00',
|
||||
'backgroundColor' => '#7ccf00',
|
||||
'borderColor' => '#7bf1a8',
|
||||
'backgroundColor' => '#7bf1a8',
|
||||
'fill' => false,
|
||||
'pointStyle' => $hasdots,
|
||||
'hidden' => true,
|
||||
@@ -365,8 +366,7 @@ class LoadPerformance
|
||||
'data' => $away_av['def'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#7ccf00',
|
||||
'backgroundColor' => 'transparent',
|
||||
'borderColor' => '#7bf1a8',
|
||||
'fill' => false,
|
||||
'pointStyle' => false,
|
||||
'borderDash' => [5, 5],
|
||||
@@ -380,8 +380,8 @@ class LoadPerformance
|
||||
'data' => $aways['att'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#7ccf00',
|
||||
'backgroundColor' => '#7ccf00',
|
||||
'borderColor' => '#7bf1a8',
|
||||
'backgroundColor' => '#7bf1a8',
|
||||
'fill' => false,
|
||||
'pointStyle' => $hasdots,
|
||||
'hidden' => true,
|
||||
@@ -394,8 +394,7 @@ class LoadPerformance
|
||||
'data' => $away_av['att'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#7ccf00',
|
||||
'backgroundColor' => 'transparent',
|
||||
'borderColor' => '#7bf1a8',
|
||||
'fill' => false,
|
||||
'pointStyle' => false,
|
||||
'borderDash' => [5, 5],
|
||||
@@ -409,27 +408,15 @@ class LoadPerformance
|
||||
'data' => $aways['mid'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#7ccf00',
|
||||
'backgroundColor' => '#7ccf00',
|
||||
'borderColor' => '#7bf1a8',
|
||||
'backgroundColor' => '#7bf1a8',
|
||||
'fill' => false,
|
||||
'pointStyle' => $hasdots,
|
||||
'hidden' => true,
|
||||
],
|
||||
[
|
||||
'label' => 'Average Midfield',
|
||||
'playing_date' => $date_away,
|
||||
'results_per_event' => $results_away,
|
||||
'events' => $events_away,
|
||||
'data' => $away_av['mid'] ?? [],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#7ccf00',
|
||||
'backgroundColor' => 'transparent',
|
||||
'fill' => false,
|
||||
'pointStyle' => false,
|
||||
'borderDash' => [5, 5],
|
||||
'hidden' => true,
|
||||
],
|
||||
/**
|
||||
* AVERAGE
|
||||
*/
|
||||
[
|
||||
'label' => 'Average League',
|
||||
'playing_date' => $date_home,
|
||||
@@ -438,8 +425,7 @@ class LoadPerformance
|
||||
'data' => $league_av['all'],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#00a6f4',
|
||||
'backgroundColor' => '#00a6f4',
|
||||
'borderColor' => '#ffb900',
|
||||
'pointStyle' => false,
|
||||
'borderDash' => [5, 5],
|
||||
'hidden' => true,
|
||||
@@ -452,8 +438,7 @@ class LoadPerformance
|
||||
'data' => $league_av['def'],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#155dfc',
|
||||
'backgroundColor' => 'transparent',
|
||||
'borderColor' => '#ffb900',
|
||||
'pointStyle' => false,
|
||||
'borderDash' => [5, 5],
|
||||
'hidden' => true,
|
||||
@@ -466,8 +451,7 @@ class LoadPerformance
|
||||
'data' => $league_av['att'],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#155dfc',
|
||||
'backgroundColor' => '#155dfc',
|
||||
'borderColor' => '#ffb900',
|
||||
'pointStyle' => false,
|
||||
'borderDash' => [5, 5],
|
||||
'hidden' => true,
|
||||
@@ -480,8 +464,7 @@ class LoadPerformance
|
||||
'data' => $league_av['mid'],
|
||||
'spanGaps' => true,
|
||||
'tension' => 0.5,
|
||||
'borderColor' => '#155dfc',
|
||||
'backgroundColor' => 'transparent',
|
||||
'borderColor' => '#ffb900',
|
||||
'pointStyle' => false,
|
||||
'borderDash' => [5, 5],
|
||||
'hidden' => true,
|
||||
|
||||
Reference in new issue
Block a user