grapper betsapi ok

This commit is contained in:
salam committed 2026-01-02 12:20:08 +01:00
1 parent b1a724061f
commit 34690292aa
15 files changed
+1751 -97

No files matched your search

+18 -3
View File
@@ -4,6 +4,7 @@ namespace App\Livewire;
use App\Filament\Tables\Columns\MapperLeftColumn;
use App\Mapper\LoadEvents;
use App\Mapper\StoreMapped;
use App\Models\CompetitionGroup;
use App\Models\Country;
use App\Models\Event;
@@ -31,6 +32,8 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
use InteractsWithSchemas;
use InteractsWithTable;
public $elements_swopped = false;
protected $listeners = [
'reload_data' => '$refresh',
];
@@ -74,7 +77,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
->searchable()
->options(function (Get $get) {
if ($get('country_id')) {
$res = Event::query()->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->where('country_id', $get('country_id'))->groupBy('competition_group_id')->pluck('competition_group_id')->toArray();
$res = Event::query()->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->whereIn('country_id', $get('country_id'))->groupBy('competition_group_id')->pluck('competition_group_id')->toArray();
} else {
$res = Event::query()->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->groupBy('competition_group_id')->pluck('competition_group_id')->toArray();
}
@@ -123,17 +126,29 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
]);
}
public function toggle()
{
$this->elements_swopped = ! $this->elements_swopped;
}
public function leftAction(): Action
{
return Action::make('left')
->modalHeading('Event Mapper')
->modalContent(function (array $arguments) {
$event = Event::where('id', $arguments['match_id'])->first();
$event = Event::where('id', $arguments['id'])->first();
$mapper = Mapper::where('event_id', $arguments['event_id'])->first();
return view('livewire.confirm-mapping', ['event' => $event, 'mapper' => $mapper, 'mappermode' => 'linear']);
return view('livewire.confirm-mapping', ['event' => $event, 'mapper' => $mapper]);
})
->action(function ($arguments) {
StoreMapped::store($arguments, $this->elements_swopped);
})
->closeModalByEscaping(false)
->modalCloseButton(false)
->closeModalByClickingAway(false)
->modalAlignment(Alignment::Center)
->modalFooterActionsAlignment(Alignment::Center)
->modalWidth('2xl')