toggle difference s book and partner; remove sport froma larm filter
This commit is contained in:
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');
|
||||
|
||||
Reference in new issue
Block a user