wip
This commit is contained in:
1 parent
57aff3ca03
commit
3eaf5f6a07
1 file changed
+9
-7
@@ -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,14 +98,16 @@ class EventResource extends Resource
|
||||
}
|
||||
|
||||
if (auth()->user()->bookmaker_partner_differences == 1) {
|
||||
$a = EventBookmaker::where('bookmaker_id', auth()->user()->bookmaker_id)
|
||||
$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();
|
||||
$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);
|
||||
|
||||
$query->whereIn('id', $e);
|
||||
}
|
||||
|
||||
if (isset((EventsTable::$bettype_settings))) {
|
||||
|
||||
Reference in new issue
Block a user