adding more filter
This commit is contained in:
1 parent
ca58eba530
commit
6b4fc0b8a1
5 files changed
+90
-15
No files matched your search
@@ -25,6 +25,7 @@ use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Forms\Components\Hidden;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Support\Enums\VerticalAlignment;
|
||||
@@ -173,7 +174,7 @@ class EventsTable
|
||||
->extremePaginationLinks()
|
||||
->filters([
|
||||
Filter::make('events')
|
||||
->columns(5)->columnSpan(5)
|
||||
->columns(8)->columnSpan(8)
|
||||
->schema([
|
||||
Hidden::make('filter_alarm_green'),
|
||||
Hidden::make('filter_alarm_yellow'),
|
||||
@@ -202,6 +203,7 @@ class EventsTable
|
||||
Select::make(name: 'country_id')
|
||||
->hidden(fn () => self::$user->sport_id == 5)
|
||||
->placeholder('Country')
|
||||
->prefixIcon('phosphor-flag')
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->multiple()
|
||||
@@ -220,6 +222,7 @@ class EventsTable
|
||||
Select::make('competition_group_id')
|
||||
->hidden(fn () => self::$user->sport_id == 5)
|
||||
->placeholder('League')
|
||||
->prefixIcon('phosphor-trophy')
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->multiple()
|
||||
@@ -242,6 +245,7 @@ class EventsTable
|
||||
Select::make('group_id')
|
||||
->visible(fn () => self::$user->sport_id == 5)
|
||||
->placeholder('Tournament')
|
||||
->prefixIcon('phosphor-trophy')
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->multiple()
|
||||
@@ -261,6 +265,7 @@ class EventsTable
|
||||
return $arr;
|
||||
})
|
||||
->live(),
|
||||
|
||||
DateRangePicker::make('starttime_period')
|
||||
->columnSpan(2)
|
||||
->displayFormat('d M Y')
|
||||
@@ -268,6 +273,50 @@ class EventsTable
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->live(),
|
||||
|
||||
TextInput::make('favorit_threshold')
|
||||
->prefixIcon('phosphor-less-than')
|
||||
->suffix('Favorit')
|
||||
->numeric()
|
||||
->minValue(1.01)
|
||||
->maxValue(3.00)
|
||||
->step(0.01)
|
||||
->hiddenLabel(),
|
||||
|
||||
Select::make('special_filter_base')
|
||||
->placeholder('Filters Base')
|
||||
->prefixIcon('phosphor-funnel')
|
||||
->hiddenLabel()
|
||||
->native(false)
|
||||
->allowHtml()
|
||||
->options([
|
||||
'sp1' => '<span class="text-blue-500">Nig ≠ Ken</div>',
|
||||
'sp3' => '<span class="text-amber-500">Favorit ≥ </div>',
|
||||
'sp4' => '<span class="text-amber-500">Favorit ≤ </div>',
|
||||
'sp5' => '<span class="text-amber-500">X ≤ </div>',
|
||||
'sp6' => '<span class="text-amber-500">Margin ≥ </div>',
|
||||
'sp7' => '<span class="text-amber-500">Margin ≤ </div>',
|
||||
]),
|
||||
|
||||
Select::make('special_filter')
|
||||
->placeholder('Special Filters')
|
||||
->prefixIcon('phosphor-funnel')
|
||||
->hiddenLabel()
|
||||
->disabled()
|
||||
->native(false)
|
||||
->allowHtml()
|
||||
->options([
|
||||
'Events' => [
|
||||
'sp1' => '<span class="text-blue-500">Nigeria > Colombia</div>',
|
||||
'sp2' => '<span class="text-blue-500">Nigeria < Colombia</div>',
|
||||
],
|
||||
'Odds' => [
|
||||
'sp3' => '<span class="text-amber-500">Favorit < Sportingbet</div>',
|
||||
'sp4' => '<span class="text-amber-500">Favorit > Sportingbet</div>',
|
||||
'sp5' => '<span class="text-amber-500">Favorit < Bet365</div>',
|
||||
'sp6' => '<span class="text-amber-500">Favorit > Bet365</div>',
|
||||
],
|
||||
]),
|
||||
])
|
||||
->query(function (Builder $query, array $data): Builder {
|
||||
return $query->when(
|
||||
@@ -349,6 +398,10 @@ class EventsTable
|
||||
});
|
||||
});
|
||||
}
|
||||
// )->when(
|
||||
// $data('favorit_threshold'),
|
||||
// function (Builder $query, $favorit_threshold) {}
|
||||
// whereRaw("LEAST(price_one, price_two, price_three) BETWEEN ? AND ?", [$min, $max])
|
||||
);
|
||||
})->indicateUsing(function (array $data): array {
|
||||
$indicators = [];
|
||||
@@ -408,6 +461,10 @@ class EventsTable
|
||||
}
|
||||
}
|
||||
|
||||
if ($data['favorit_threshold'] ?? null) {
|
||||
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info');
|
||||
}
|
||||
|
||||
if ($data['stars_status'] ?? null) {
|
||||
$indicators[] = Indicator::make('Favorits')->removeField('stars_status')->color('info');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class PartnerProgramm extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.partner-programm');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user