fix players with season

This commit is contained in:
salam committed 2026-08-31 08:35:28 +02:00
1 parent 1949a06480
commit 9b8bbefa5e
2 files changed
+11 -3

No files matched your search

+9 -2
View File
@@ -2,6 +2,7 @@
namespace App\Filament\Widgets\Data;
use App\Filament\Pages\Selections\Helper\GetSeason;
use App\Models\StatistikoDetail;
use App\Models\StatistikoEvent;
use App\Models\StatistikoPlayer;
@@ -28,6 +29,11 @@ class LoadPlayer
$player_on_field = $filter['player_on_field'] ?? 'all';
$season = $filter['season'];
$seasonmode = $filter['seasonmode'];
$season = GetSeason::load($season, $seasonmode);
// dd($player_on_field);
$statistic_type = $filter['statistic_type'] ?? 'gls';
@@ -50,7 +56,8 @@ class LoadPlayer
$player_name = StatistikoDetail::where('ss_player_id', (int) $ss_player_id)->value('player_name');
$matches_season = StatistikoEvent::where(function ($query) use ($team_id, $team_position) {
$matches_season = StatistikoEvent::whereIn('season', $season)
->where(function ($query) use ($team_id, $team_position) {
switch ($team_position) {
case 'home':
return $query->where('home_id', '=', $team_id);
@@ -144,7 +151,7 @@ class LoadPlayer
}
$avverage = array_sum($dataset) / count($dataset);
$dataset2 = array_fill(0,count($dataset), $avverage);
$dataset2 = array_fill(0, count($dataset), $avverage);
@@ -2,9 +2,10 @@
namespace App\Filament\Widgets\Data;
use Illuminate\Support\Carbon;
use App\Filament\Pages\Selections\Helper\GetSeason;
use App\Models\StatistikoDetail;
use App\Models\StatistikoPlayer;
use Illuminate\Support\Carbon;
class LoadPlayerPerformance
{