wip
This commit is contained in:
1 parent
2d18d91909
commit
9f75e1a740
1 file changed
+9
-1
@@ -8,12 +8,12 @@ use App\Filament\Resources\Events\Tables\EventsTable;
|
||||
use App\Filament\Resources\Events\Tables\Tools\LoadClientStartimeDifference;
|
||||
use App\Filament\Resources\Events\Tables\Tools\LoadPartnerDifferences;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventBookmaker;
|
||||
use Carbon\Carbon;
|
||||
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,6 +98,14 @@ 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])
|
||||
|
||||
Reference in new issue
Block a user