From 4ec3a86c9ecfdd819e8e63fa5d15b257e6445032 Mon Sep 17 00:00:00 2001 From: salam Date: Sun, 30 Aug 2026 05:39:11 +0200 Subject: [PATCH] wip --- app/Console/Commands/Grapper/Sofascore/Grapper.php | 2 +- app/Console/Commands/Grapper/Sofascore/Helper/LoadDays.php | 4 ++++ app/Filament/Widgets/Data/LoadEvents.php | 2 +- app/Filament/Widgets/Data/LoadEvents/LoadEventsQuery.php | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/Grapper/Sofascore/Grapper.php b/app/Console/Commands/Grapper/Sofascore/Grapper.php index c2ea2973..86974277 100644 --- a/app/Console/Commands/Grapper/Sofascore/Grapper.php +++ b/app/Console/Commands/Grapper/Sofascore/Grapper.php @@ -93,7 +93,7 @@ class Grapper if (! $force && SofaScoreEventGrapped::where('id', (int) $event['id'])->exists()) { if ($debug) { - Notice::note('Grapped ' . $day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'g'); + Notice::note('Allready grapped at ' . $day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'g'); } } else { diff --git a/app/Console/Commands/Grapper/Sofascore/Helper/LoadDays.php b/app/Console/Commands/Grapper/Sofascore/Helper/LoadDays.php index 6b1498af..886b16e0 100644 --- a/app/Console/Commands/Grapper/Sofascore/Helper/LoadDays.php +++ b/app/Console/Commands/Grapper/Sofascore/Helper/LoadDays.php @@ -80,6 +80,10 @@ class LoadDays Notice::note('NO DATES OR ALL GRAPPED', 'br', 1); } + if ($debug) { + Notice::note($dates, 'b'); + } + // remove when element in array is double (day and slug) $dates = array_unique($dates, SORT_REGULAR); diff --git a/app/Filament/Widgets/Data/LoadEvents.php b/app/Filament/Widgets/Data/LoadEvents.php index 50f6601a..ba793565 100644 --- a/app/Filament/Widgets/Data/LoadEvents.php +++ b/app/Filament/Widgets/Data/LoadEvents.php @@ -88,7 +88,7 @@ class LoadEvents $team_position = 'all'; } - if (!isset($res['all'])) { + if (!isset($res['all']) || !isset($res[$team_position])) { return []; } diff --git a/app/Filament/Widgets/Data/LoadEvents/LoadEventsQuery.php b/app/Filament/Widgets/Data/LoadEvents/LoadEventsQuery.php index 7848ce76..a61dfdf9 100644 --- a/app/Filament/Widgets/Data/LoadEvents/LoadEventsQuery.php +++ b/app/Filament/Widgets/Data/LoadEvents/LoadEventsQuery.php @@ -98,7 +98,7 @@ class LoadEventsQuery ->where(function ($query) use ($team_id, $home_id, $away_id, $similar_past_matches) { if ($similar_past_matches == 'none') { if ($team_id) { - return $query->where('home_id', $team_id) + return $query->orWhere('home_id', $team_id) ->orWhere('away_id', '=', $team_id); } else { return $query->whereIn('home_id', [$home_id, $away_id])->orWhereIn('away_id', [$home_id, $away_id]);