toggle difference s book and partner; remove sport froma larm filter

This commit is contained in:
salam committed 2026-02-07 12:23:46 +01:00
1 parent 7c0fd2b7a0
commit 4e64f2f318
12 files changed
+84 -90

No files matched your search

@@ -7,6 +7,7 @@ use App\Filament\Resources\Events\Schemas\EventForm;
use App\Filament\Resources\Events\Tables\EventsTable;
use App\Filament\Resources\Events\Tables\Tools\LoadPartnerDifferences;
use App\Models\Event;
use App\Models\EventBookmaker;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Table;
@@ -80,6 +81,17 @@ class EventResource extends Resource
$query->whereIn('id', $event_ids);
}
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);
}
if (isset((EventsTable::$bettype_settings))) {
if (in_array('odds_2ways', EventsTable::$bettype_settings)) {
$query->with('odds_2ways.bookmaker');
@@ -41,6 +41,11 @@ class ListEvents extends ListRecords
// $this->dispatch('refreshMapperRight');
}
public function updateCompareDifferences(): void
{
$this->tableFilters['events']['bookmaker_partner_differences'] = ! $this->tableFilters['events']['bookmaker_partner_differences'];
}
public function updateStar(): void
{
$this->tableFilters['events']['filter_stars'] = ! $this->tableFilters['events']['filter_stars'];
@@ -486,7 +486,11 @@ class EventsTable
$indicators[] = Indicator::make('With '.auth()->user()->partnerbookmaker->name)->color('info')->removable(false);
}
if (auth()->user()->partner_compare == 1) {
$indicators[] = Indicator::make('Difference '.auth()->user()->bookmaker->name.' vs '.auth()->user()->partnerbookmaker->name)->color('info')->removable(false);
$indicators[] = Indicator::make('Difference odds '.auth()->user()->bookmaker->name.' vs '.auth()->user()->partnerbookmaker->name)->color('info')->removable(false);
}
if (auth()->user()->bookmaker_partner_differences == 1) {
$indicators[] = Indicator::make('Different events '.auth()->user()->bookmaker->name.' vs '.auth()->user()->partnerbookmaker->name)->color('home');
}
if ($data['filter_notes'] ?? null) {