fix date since label in LoadPerformance
This commit is contained in:
1 parent
d946a2f846
commit
da03b60445
2 files changed
+29
-31
No files matched your search
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Filament\Widgets\Data;
|
namespace App\Filament\Widgets\Data;
|
||||||
|
|
||||||
use App\Models\StatisticFixtures;
|
use Illuminate\Support\Carbon;
|
||||||
use App\Models\StatistikoEvent;
|
use App\Models\StatistikoEvent;
|
||||||
use App\Models\StatistikoPlayer;
|
use App\Models\StatistikoPlayer;
|
||||||
use Illuminate\Support\Carbon;
|
use App\Models\StatisticFixtures;
|
||||||
|
|
||||||
class LoadPerformance
|
class LoadPerformance
|
||||||
{
|
{
|
||||||
@@ -108,8 +108,6 @@ class LoadPerformance
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// dd($home_matches);
|
|
||||||
|
|
||||||
$res = StatistikoPlayer::whereIn('match_id', $home_matches)->select('match_id', 'minutes_played', 'playerrating_value', 'player_position')->get();
|
$res = StatistikoPlayer::whereIn('match_id', $home_matches)->select('match_id', 'minutes_played', 'playerrating_value', 'player_position')->get();
|
||||||
$homes = self::filterMatches($res, $home_matches);
|
$homes = self::filterMatches($res, $home_matches);
|
||||||
|
|
||||||
@@ -135,7 +133,7 @@ class LoadPerformance
|
|||||||
$data = [
|
$data = [
|
||||||
'datasets' => [
|
'datasets' => [
|
||||||
[
|
[
|
||||||
'label' => $match->home->name,
|
'label' => $match->home->ss_team_name,
|
||||||
'playing_date' => $date_home,
|
'playing_date' => $date_home,
|
||||||
'results_per_event' => $results_home,
|
'results_per_event' => $results_home,
|
||||||
'events' => $events_home,
|
'events' => $events_home,
|
||||||
@@ -155,7 +153,7 @@ class LoadPerformance
|
|||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#fb2c36',
|
'borderColor' => '#fb2c36',
|
||||||
'backgroundColor' => '#fb2c36',
|
'backgroundColor' => 'transparent',
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
],
|
],
|
||||||
@@ -167,8 +165,8 @@ class LoadPerformance
|
|||||||
'data' => $homes['def'] ?? [],
|
'data' => $homes['def'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#ff6900',
|
'borderColor' => '#e60076',
|
||||||
'backgroundColor' => '#ff6900',
|
'backgroundColor' => '#e60076',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -181,8 +179,8 @@ class LoadPerformance
|
|||||||
'data' => $home_av['def'],
|
'data' => $home_av['def'],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#ff6900',
|
'borderColor' => '#e60076',
|
||||||
'backgroundColor' => '#ff6900',
|
'backgroundColor' => 'transparent',
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
@@ -195,8 +193,8 @@ class LoadPerformance
|
|||||||
'data' => $homes['att'] ?? [],
|
'data' => $homes['att'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#ff6900',
|
'borderColor' => '#e60076',
|
||||||
'backgroundColor' => '#ff6900',
|
'backgroundColor' => '#e60076',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -209,8 +207,8 @@ class LoadPerformance
|
|||||||
'data' => $home_av['att'] ?? [],
|
'data' => $home_av['att'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#ff6900',
|
'borderColor' => '#e60076',
|
||||||
'backgroundColor' => '#ff6900',
|
'backgroundColor' => 'transparent',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -224,8 +222,8 @@ class LoadPerformance
|
|||||||
'data' => $homes['mid'] ?? [],
|
'data' => $homes['mid'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#ff6900',
|
'borderColor' => '#e60076',
|
||||||
'backgroundColor' => '#ff6900',
|
'backgroundColor' => '#e60076',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -238,15 +236,15 @@ class LoadPerformance
|
|||||||
'data' => $home_av['mid'] ?? [],
|
'data' => $home_av['mid'] ?? [],
|
||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#ff6900',
|
'borderColor' => '#e60076',
|
||||||
'backgroundColor' => '#ff6900',
|
'backgroundColor' => 'transparent',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => $match->away->name,
|
'label' => $match->away->ss_team_name,
|
||||||
'playing_date' => $date_away,
|
'playing_date' => $date_away,
|
||||||
'results_per_event' => $results_away,
|
'results_per_event' => $results_away,
|
||||||
'events' => $events_away,
|
'events' => $events_away,
|
||||||
@@ -257,7 +255,7 @@ class LoadPerformance
|
|||||||
'backgroundColor' => '#00c950',
|
'backgroundColor' => '#00c950',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => $hasdots,
|
'pointStyle' => $hasdots,
|
||||||
'hidden' => true,
|
'hidden' => false,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => 'Average Team',
|
'label' => 'Average Team',
|
||||||
@@ -268,11 +266,11 @@ class LoadPerformance
|
|||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#00c950',
|
'borderColor' => '#00c950',
|
||||||
'backgroundColor' => '#00c950',
|
'backgroundColor' => 'transparent',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'hidden' => true,
|
'hidden' => false,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => 'Defence',
|
'label' => 'Defence',
|
||||||
@@ -297,7 +295,7 @@ class LoadPerformance
|
|||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#009966',
|
'borderColor' => '#009966',
|
||||||
'backgroundColor' => '#009966',
|
'backgroundColor' => 'transparent',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
@@ -326,7 +324,7 @@ class LoadPerformance
|
|||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#009966',
|
'borderColor' => '#009966',
|
||||||
'backgroundColor' => '#009966',
|
'backgroundColor' => 'transparent',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
@@ -355,7 +353,7 @@ class LoadPerformance
|
|||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#009966',
|
'borderColor' => '#009966',
|
||||||
'backgroundColor' => '#009966',
|
'backgroundColor' => 'transparent',
|
||||||
'fill' => false,
|
'fill' => false,
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
@@ -384,7 +382,7 @@ class LoadPerformance
|
|||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#155dfc',
|
'borderColor' => '#155dfc',
|
||||||
'backgroundColor' => '#155dfc',
|
'backgroundColor' => 'transparent',
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -412,7 +410,7 @@ class LoadPerformance
|
|||||||
'spanGaps' => true,
|
'spanGaps' => true,
|
||||||
'tension' => 0.5,
|
'tension' => 0.5,
|
||||||
'borderColor' => '#155dfc',
|
'borderColor' => '#155dfc',
|
||||||
'backgroundColor' => '#155dfc',
|
'backgroundColor' => 'transparent',
|
||||||
'pointStyle' => false,
|
'pointStyle' => false,
|
||||||
'borderDash' => [5, 5],
|
'borderDash' => [5, 5],
|
||||||
'hidden' => true,
|
'hidden' => true,
|
||||||
@@ -538,8 +536,8 @@ class LoadPerformance
|
|||||||
$aways['att'] = array_slice($aways['att'], 0, $keeps);
|
$aways['att'] = array_slice($aways['att'], 0, $keeps);
|
||||||
$aways['mid'] = array_slice($aways['mid'], 0, $keeps);
|
$aways['mid'] = array_slice($aways['mid'], 0, $keeps);
|
||||||
}
|
}
|
||||||
// $labels = array_slice($labels, 0, $keeps);
|
$labels = array_slice($labels, 0, $keeps);
|
||||||
$labels = range(1, $keeps);
|
// $labels = range(1, $keeps);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function makeAv(array &$arr, int $length)
|
public static function makeAv(array &$arr, int $length)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Livewire\Mapper;
|
namespace App\Livewire\Mapper;
|
||||||
|
|
||||||
use App\Models\Element;
|
|
||||||
use App\Models\Event;
|
use App\Models\Event;
|
||||||
use App\Models\Mapper;
|
use App\Models\Mapper;
|
||||||
|
use App\Models\Element;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class LoadEvents
|
class LoadEvents
|
||||||
@@ -20,7 +20,7 @@ class LoadEvents
|
|||||||
if ($search_values) {
|
if ($search_values) {
|
||||||
$element_ids = Element::where(function ($query) use ($search_values) {
|
$element_ids = Element::where(function ($query) use ($search_values) {
|
||||||
foreach ($search_values as $value) {
|
foreach ($search_values as $value) {
|
||||||
$query->orWhere('name', 'LIKE', '%'.$value.'%');
|
$query->orWhere('name', 'LIKE', '%' . $value . '%');
|
||||||
}
|
}
|
||||||
})->pluck('id')->toArray();
|
})->pluck('id')->toArray();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user