fix players with season
This commit is contained in:
1 parent
1949a06480
commit
9b8bbefa5e
2 files changed
+10
-2
No files matched your search
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Filament\Widgets\Data;
|
namespace App\Filament\Widgets\Data;
|
||||||
|
|
||||||
|
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||||
use App\Models\StatistikoDetail;
|
use App\Models\StatistikoDetail;
|
||||||
use App\Models\StatistikoEvent;
|
use App\Models\StatistikoEvent;
|
||||||
use App\Models\StatistikoPlayer;
|
use App\Models\StatistikoPlayer;
|
||||||
@@ -28,6 +29,11 @@ class LoadPlayer
|
|||||||
|
|
||||||
$player_on_field = $filter['player_on_field'] ?? 'all';
|
$player_on_field = $filter['player_on_field'] ?? 'all';
|
||||||
|
|
||||||
|
|
||||||
|
$season = $filter['season'];
|
||||||
|
$seasonmode = $filter['seasonmode'];
|
||||||
|
$season = GetSeason::load($season, $seasonmode);
|
||||||
|
|
||||||
// dd($player_on_field);
|
// dd($player_on_field);
|
||||||
|
|
||||||
$statistic_type = $filter['statistic_type'] ?? 'gls';
|
$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');
|
$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) {
|
switch ($team_position) {
|
||||||
case 'home':
|
case 'home':
|
||||||
return $query->where('home_id', '=', $team_id);
|
return $query->where('home_id', '=', $team_id);
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Filament\Widgets\Data;
|
namespace App\Filament\Widgets\Data;
|
||||||
|
|
||||||
use Illuminate\Support\Carbon;
|
use App\Filament\Pages\Selections\Helper\GetSeason;
|
||||||
use App\Models\StatistikoDetail;
|
use App\Models\StatistikoDetail;
|
||||||
use App\Models\StatistikoPlayer;
|
use App\Models\StatistikoPlayer;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
class LoadPlayerPerformance
|
class LoadPlayerPerformance
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user