fix date since label in LoadPerformance

This commit is contained in:
salam committed 2026-08-04 08:54:23 +02:00
1 parent d946a2f846
commit da03b60445
2 files changed
+29 -31

No files matched your search

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