This commit is contained in:
salam committed 2026-01-26 12:17:24 +01:00
1 parent 49b1eba348
commit 9ca5657827
28 files changed
+288 -234

No files matched your search

@@ -58,33 +58,20 @@ class EventResource extends Resource
->with('home')
->with('away')
->with('event_user_star')
->with('event_bookmaker')
->where('starttime', '>=', now());
if (auth()->user()->stars) {
$query->whereHas('event_user_star');
}
if (auth()->user()->all_only_none) {
switch (auth()->user()->bookmaker_id) {
case 10:
$field = 'magnig_id';
break;
case 16:
$field = 'magken_id';
break;
case 35:
$field = 'lognig_id';
break;
case 36:
$field = 'logcol_id';
break;
}
if (auth()->user()->all_only_none > 0) {
switch (auth()->user()->all_only_none) {
case 1:
$query->where($field, 1);
$query->whereHas('event_bookmaker');
break;
case 2:
$query->where($field, 0);
$query->doesntHave('event_bookmaker');
break;
}
}
@@ -11,6 +11,7 @@ use App\Filament\Tables\Columns\TooltipOdds;
use App\Models\CompetitionGroup;
use App\Models\Country;
use App\Models\Event;
use App\Models\EventBookmaker;
use App\Models\EventUserStar;
use App\Models\Group;
use App\Models\Sport;
@@ -33,6 +34,7 @@ use Filament\Tables\Filters\Indicator;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
class EventsTable
{
@@ -164,7 +166,7 @@ class EventsTable
->verticalAlignment(VerticalAlignment::Start)
->label('Draw No Bet'),
])->searchable(['id', 'home.name', 'away.name', 'betsapi_id', 'betradar_id', 'bet365_id', 'bwin_id', 'magnig_id', 'magken_id', 'lognig_id', 'logcol_id'])
])->searchable(['id', 'home.name', 'away.name', 'betsapi_id', 'betradar_id', 'bet365_id', 'bwin_id', 'event_bookmaker.event_id'])
->defaultSort('starttime', 'ASC')
->extremePaginationLinks()
->filters([
@@ -349,7 +351,7 @@ class EventsTable
->recordActions([
Action::make('star')
->iconButton()
// ->color('gray')
->color('gray')
->icon(function ($record) {
if (isset($record->event_user_star->id)) {
return 'phosphor-star-fill';
@@ -377,6 +379,14 @@ class EventsTable
->icon('phosphor-arrow-square-out')
->url(fn ($record): string => route('txodds_odds', ['sportid' => $record->sport_id, 'txoddsid' => $record->id]))
->openUrlInNewTab(),
Action::make('swap_elements')
->icon('phosphor-swap')
->action(function ($record, $livewire) {
EventBookmaker::where('event_id', $record->id)->where('bookmaker_id', auth()->user()->bookmaker_id)->update(['is_swopped' => DB::raw('!is_swopped')]);
$livewire->dispatch('refreshBettypeMenu');
}),
])->iconButton()
->icon('phosphor-dots-three-vertical'),
])->toolbarActions([
@@ -39,6 +39,7 @@ class LoadMultiline
}
$res = MultilineClient::with('multiline_setting')
->where('client_bookmaker_id', auth()->user()->bookmaker_id)
->select('bookmaker_id', 'multiline_setting_id')
->orderBy('sort')
->get();