mapper provider wip
This commit is contained in:
1 parent
b3318b1c03
commit
a487fe0838
11 files changed
+161
-92
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Actions\MapperEvents;
|
||||
use App\Filament\Tables\Columns\MapperLeftColumn;
|
||||
use App\Models\CompetitionGroup;
|
||||
use App\Models\Country;
|
||||
@@ -37,7 +38,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(Event::query()->where('betradar_id', 0))
|
||||
->query(MapperEvents::load())
|
||||
->columns([
|
||||
MapperLeftColumn::make('left')->label(''),
|
||||
])
|
||||
@@ -112,7 +113,8 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
Action::make('reload_data_left')
|
||||
->hiddenLabel()
|
||||
->color('gray')
|
||||
->icon('phosphor-x')
|
||||
->icon('heroicon-o-arrow-path')
|
||||
// ->icon('phosphor-x')
|
||||
->action(function (Component $livewire) {
|
||||
$livewire->resetTableFiltersForm(); // Clears all filters
|
||||
$livewire->tableSearch = ''; // Clears the main search bar
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Actions\MapperProvider;
|
||||
use App\Filament\Tables\Columns\MapperRightColumn;
|
||||
use App\Models\Event;
|
||||
use App\Models\Mapper;
|
||||
@@ -33,7 +34,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(Mapper::query())
|
||||
->query(MapperProvider::load())
|
||||
->columns([
|
||||
MapperRightColumn::make('right')->label(''),
|
||||
])->searchable(['home', 'away'])
|
||||
@@ -86,7 +87,8 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
Action::make('reload_data')
|
||||
->hiddenLabel()
|
||||
->color('gray')
|
||||
->icon('phosphor-x')
|
||||
->icon('heroicon-o-arrow-path')
|
||||
// ->icon('phosphor-x')
|
||||
->action(function (Component $livewire) {
|
||||
$livewire->resetTableFiltersForm(); // Clears all filters
|
||||
$livewire->tableSearch = ''; // Clears the main search bar
|
||||
|
||||
@@ -54,11 +54,15 @@ class TopMenuItems extends Component
|
||||
|
||||
public function swop($client_id)
|
||||
{
|
||||
$providers = Client::where('id', $client_id)->pluck('provider')->first();
|
||||
|
||||
$provider_id = array_shift($providers);
|
||||
|
||||
$bookmakers = Client::where('id', $client_id)->pluck('bookmaker')->first();
|
||||
|
||||
$bookmaker_id = array_shift($bookmakers);
|
||||
|
||||
User::where('id', auth()->user()->id)->update(['bookmaker_mapper_id' => $bookmaker_id, 'bookmaker_id' => $bookmaker_id, 'client_id' => $client_id]);
|
||||
User::where('id', auth()->user()->id)->update(['provider_id' => $provider_id, 'bookmaker_id' => $bookmaker_id, 'client_id' => $client_id]);
|
||||
|
||||
$this->js('window.location.reload()');
|
||||
}
|
||||
@@ -70,9 +74,9 @@ class TopMenuItems extends Component
|
||||
$this->js('window.location.reload()');
|
||||
}
|
||||
|
||||
public function swopMapper($bookmaker_id)
|
||||
public function swopProvider($provider_id)
|
||||
{
|
||||
User::where('id', auth()->user()->id)->update(['bookmaker_mapper_id' => $bookmaker_id]);
|
||||
User::where('id', auth()->user()->id)->update(['provider_id' => $provider_id]);
|
||||
|
||||
$this->dispatch('reload_data');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user