diff --git a/app/Filament/Resources/Events/Tables/EventsTable.php b/app/Filament/Resources/Events/Tables/EventsTable.php index 83d2723b..e6e7da79 100644 --- a/app/Filament/Resources/Events/Tables/EventsTable.php +++ b/app/Filament/Resources/Events/Tables/EventsTable.php @@ -312,9 +312,6 @@ class EventsTable function (Builder $query, $country_id) { $query->whereIn('country_id', $country_id); } - )->when( - $data['group_id'], - fn (Builder $query, $group_id) => $query->whereIn('group_id', $group_id) )->when( $data['competition_group_id'], fn (Builder $query, $competition_group_id) => $query->whereIn('competition_group_id', $competition_group_id) diff --git a/app/Livewire/BettypeToggle.php b/app/Livewire/BettypeToggle.php index 7ba41e3d..7284bdc4 100644 --- a/app/Livewire/BettypeToggle.php +++ b/app/Livewire/BettypeToggle.php @@ -157,7 +157,13 @@ class BettypeToggle extends Component ->where('sport_id', auth()->user()->sport_id) ->count(); - $this->bookmakerPartnerDiffrences = abs($this->bookmakerCount - $this->partnerCount); + $this->bookmakerPartnerDiffrences = DB::table('event_bookmakers') + ->selectRaw('count(id) as c, event_id') + ->whereIn('bookmaker_id', [auth()->user()->bookmaker_id, auth()->user()->partner_bookmaker_id]) + ->where('starttime', '>', Carbon::now()->timezone('CET')) + ->groupBy('event_id') + ->havingRaw('c = 1') + ->count(); } public function toggleBookmakerPartnerDiffrences()