This commit is contained in:
salam committed 2026-02-27 17:02:30 +01:00
1 parent 9f75e1a740
commit 0a32a32ba0
1 file changed
+16 -15
+16 -15
View File
@@ -14,6 +14,7 @@ use Filament\Resources\Resource;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Tables\Table; use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\DB;
class EventResource extends Resource class EventResource extends Resource
{ {
@@ -98,24 +99,24 @@ class EventResource extends Resource
} }
if (auth()->user()->bookmaker_partner_differences == 1) { if (auth()->user()->bookmaker_partner_differences == 1) {
$a = EventBookmaker::where('bookmaker_id', auth()->user()->bookmaker_id) // $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])
// ->where('sport_id', auth()->user()->sport_id) // ->where('sport_id', auth()->user()->sport_id)
// ->where('starttime', '>', Carbon::now()->timezone('CET'))
// ->groupBy('event_id')
// ->havingRaw('c = 1')
// ->pluck('event_id')->toArray(); // ->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])
->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>', Carbon::now()->timezone('CET'))
->groupBy('event_id')
->havingRaw('c = 1')
->pluck('event_id')->toArray();
// $query->whereIn('id', $e); $query->whereIn('id', $e);
} }
if (isset((EventsTable::$bettype_settings))) { if (isset((EventsTable::$bettype_settings))) {