From f40009a878e9d08bc8202b87f8ad75baa7dbeb89 Mon Sep 17 00:00:00 2001 From: salam Date: Thu, 21 May 2026 15:44:02 +0200 Subject: [PATCH] StatistikoEvent in LoadEvents for statistiks --- app/Actions/Statistics/LoadEvents.php | 9 ++++----- app/Filament/Imports/Helper/ImportEvents.php | 8 +++++++- app/Filament/Pages/Statistic.php | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/Actions/Statistics/LoadEvents.php b/app/Actions/Statistics/LoadEvents.php index 15214f08..75365855 100644 --- a/app/Actions/Statistics/LoadEvents.php +++ b/app/Actions/Statistics/LoadEvents.php @@ -2,7 +2,6 @@ namespace App\Actions\Statistics; -use App\Models\StatisticFixtures; use App\Models\StatistikoEvent; class LoadEvents @@ -33,17 +32,17 @@ class LoadEvents /** * ACCURACY DATA */ - switch ($filter['team_position']) { + switch ($team_position) { case 'home': - $res = StatisticFixtures::where('league_id', $league_id)->where('home_id', $team_id)->first(); + $res = StatistikoEvent::where('league_id', $league_id)->where('home_id', $team_id)->first(); break; case 'away': - $res = StatisticFixtures::where('league_id', $league_id)->where('away_id', $team_id)->first(); + $res = StatistikoEvent::where('league_id', $league_id)->where('away_id', $team_id)->first(); break; default: - $res = StatisticFixtures::where('league_id', $league_id) + $res = StatistikoEvent::where('league_id', $league_id) ->where(function ($query) use ($team_id) { $query->where('home_id', '=', $team_id)->orWhere('away_id', '=', $team_id); })->first(); diff --git a/app/Filament/Imports/Helper/ImportEvents.php b/app/Filament/Imports/Helper/ImportEvents.php index 069746d3..d884e5b3 100644 --- a/app/Filament/Imports/Helper/ImportEvents.php +++ b/app/Filament/Imports/Helper/ImportEvents.php @@ -22,7 +22,13 @@ class ImportEvents $row = array_values($row); - dd($row); + /* + 0 => 14082828 + 1 => 1 + 2 => 12 + 3 => 1661 + 4 => 4781 + */ StatistikoEvent::where('match_id', $row[0]) ->where('sport_id', $row[1]) diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php index 23eff886..01d0a22e 100644 --- a/app/Filament/Pages/Statistic.php +++ b/app/Filament/Pages/Statistic.php @@ -85,7 +85,7 @@ class Statistic extends BaseDashboard ->columnSpanFull(), Section::make() ->schema([ - Select::make('palyer_id') + Select::make('tm_player_id') ->label('Player') ->prefixIcon('icon-player') ->options([