From 407f773dec5e63063115ed6e12c73c5a8d76de8e Mon Sep 17 00:00:00 2001 From: salam Date: Sat, 10 Oct 2026 12:56:29 +0200 Subject: [PATCH] SofaScorePlayerPerSeason alst180days also in PlayerCalculator --- app/Filament/Widgets/PlayerPropsDrop.php | 5 +++++ app/Livewire/PlayerCalculator.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Filament/Widgets/PlayerPropsDrop.php b/app/Filament/Widgets/PlayerPropsDrop.php index 59df875e..c8e9cbe8 100644 --- a/app/Filament/Widgets/PlayerPropsDrop.php +++ b/app/Filament/Widgets/PlayerPropsDrop.php @@ -392,7 +392,9 @@ class PlayerPropsDrop extends Widget $player_totals = SofaScorePlayerPerSeason::with('details')->where('total_min', '>', 0)->where('season', 'last_180_days')->where('average_min', '>', 0)->where('ss_team_id', $team_id)->get(); $count_player = 0; + $tmp = []; foreach ($player_totals as $key => $value) { + $tmp[] = $value->details->ss_player_id; if ($value->details != null && $value->details->position != 'GK' && (int) $value->details->is_active) { $count_player++; } @@ -682,6 +684,9 @@ class PlayerPropsDrop extends Widget $players = SofaScorePlayerPerSeason::with('details')->where('season', 'last_180_days')->where('ss_team_id', $this->team_id)->where('average_min', '>', 0)->get(); $arr = collect(); foreach ($players as $value) { + if ($value->details->player_name == 'Thomas de Martis') { + dd($value); + } if ($value?->details->position ?? 0) { $arr->push([ 'id' => $value->ss_player_id, diff --git a/app/Livewire/PlayerCalculator.php b/app/Livewire/PlayerCalculator.php index 5d28de18..1a88b248 100644 --- a/app/Livewire/PlayerCalculator.php +++ b/app/Livewire/PlayerCalculator.php @@ -12,8 +12,8 @@ class PlayerCalculator extends Component { $positions_map = LoadPositions::load(); - $player = SofaScorePlayerPerSeason::with('details')->where('season', '=', 'total')->where('ss_team_id', '=', $team_id)->get(); - + // $player = SofaScorePlayerPerSeason::with('details')->where('season', '=', 'total')->where('ss_team_id', '=', $team_id)->get(); + $player = SofaScorePlayerPerSeason::with('details')->where('total_min', '>', 0)->where('season', 'last_180_days')->where('average_min', '>', 0)->where('ss_team_id', $team_id)->get(); $result = []; foreach ($player as $val) { if ($val->details != null && $val->details->is_active) {