From 0a32a32ba042a45774ffc92cb43b1877f99bdf0a Mon Sep 17 00:00:00 2001 From: salam Date: Fri, 27 Feb 2026 17:02:30 +0100 Subject: [PATCH] wip --- .../Resources/Events/EventResource.php | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/app/Filament/Resources/Events/EventResource.php b/app/Filament/Resources/Events/EventResource.php index cd35346f..1eb78b1f 100644 --- a/app/Filament/Resources/Events/EventResource.php +++ b/app/Filament/Resources/Events/EventResource.php @@ -14,6 +14,7 @@ use Filament\Resources\Resource; use Filament\Schemas\Schema; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Support\Facades\DB; class EventResource extends Resource { @@ -98,24 +99,24 @@ class EventResource extends Resource } if (auth()->user()->bookmaker_partner_differences == 1) { - $a = EventBookmaker::where('bookmaker_id', auth()->user()->bookmaker_id) - ->where('sport_id', auth()->user()->sport_id) - ->pluck('event_id')->toArray(); - $b = EventBookmaker::where('bookmaker_id', auth()->user()->partner_bookmaker_id) - ->where('sport_id', auth()->user()->sport_id) - ->pluck('event_id')->toArray(); - $result = array_diff($a, $b); - $query->whereIn('id', $result); - // $e = DB::table('event_bookmakers') - // ->selectRaw('count(id) as c, event_id') - // ->whereIn('bookmaker_id', [auth()->user()->bookmaker_id, auth()->user()->partner_bookmaker_id]) + // $a = EventBookmaker::where('bookmaker_id', auth()->user()->bookmaker_id) // ->where('sport_id', auth()->user()->sport_id) - // ->where('starttime', '>', Carbon::now()->timezone('CET')) - // ->groupBy('event_id') - // ->havingRaw('c = 1') // ->pluck('event_id')->toArray(); + // $b = EventBookmaker::where('bookmaker_id', auth()->user()->partner_bookmaker_id) + // ->where('sport_id', auth()->user()->sport_id) + // ->pluck('event_id')->toArray(); + // $result = array_diff($a, $b); + // $query->whereIn('id', $result); + $e = DB::table('event_bookmakers') + ->selectRaw('count(id) as c, event_id') + ->whereIn('bookmaker_id', [auth()->user()->bookmaker_id, auth()->user()->partner_bookmaker_id]) + ->where('sport_id', auth()->user()->sport_id) + ->where('starttime', '>', Carbon::now()->timezone('CET')) + ->groupBy('event_id') + ->havingRaw('c = 1') + ->pluck('event_id')->toArray(); - // $query->whereIn('id', $e); + $query->whereIn('id', $e); } if (isset((EventsTable::$bettype_settings))) {