wip filter
This commit is contained in:
1 parent
c4d7f2e6ee
commit
d2caac4bcc
20 files changed
+567
-119
No files matched your search
@@ -17,7 +17,7 @@ class ClientResource extends Resource
|
||||
|
||||
protected static ?int $navigationSort = 32;
|
||||
|
||||
protected static string|\BackedEnum|null $navigationIcon = 'lucide-square-user';
|
||||
protected static string|\BackedEnum|null $navigationIcon = 'phosphor-baseball-helmet';
|
||||
|
||||
protected static ?string $cluster = AdministratorCluster::class;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\Events\Tables;
|
||||
|
||||
use App\Filament\Tables\Columns\Column3way;
|
||||
use App\Filament\Tables\Columns\Column3wayHt;
|
||||
use App\Filament\Tables\Columns\ColumnDc;
|
||||
use App\Filament\Tables\Columns\ColumnDnb;
|
||||
use App\Filament\Tables\Columns\ColumnGgng;
|
||||
@@ -11,6 +12,7 @@ use App\Filament\Tables\Columns\ColumnMlS1;
|
||||
use App\Filament\Tables\Columns\ColumnPoint;
|
||||
use App\Filament\Tables\Columns\ColumnPointQ1;
|
||||
use App\Filament\Tables\Columns\ColumnTotal;
|
||||
use App\Filament\Tables\Columns\ColumnTotalHt;
|
||||
use App\Filament\Tables\Columns\ColumnTotalQ1;
|
||||
use App\Filament\Tables\Columns\ColumnTq;
|
||||
use App\Filament\Tables\Columns\MatchIds;
|
||||
@@ -47,7 +49,12 @@ class EventsTable
|
||||
|
||||
public static function load_multiline_bookmaker()
|
||||
{
|
||||
$res = MultilineClient::with('multiline_setting')->where('client_id', auth()->user()->client_id)->where('sport_id', auth()->user()->sport_id)->select('bookmaker_id', 'multiline_setting_id')->orderBy('multiline_setting_id')->orderBy('sort')->get();
|
||||
$res = MultilineClient::with('multiline_setting')
|
||||
->where('client_id', auth()->user()->client_id)
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->select('bookmaker_id', 'multiline_setting_id')
|
||||
->orderBy('sort')
|
||||
->get();
|
||||
|
||||
foreach ($res as $value) {
|
||||
self::$multiline_gettype[$value->multiline_setting->table][] = $value->bookmaker_id;
|
||||
@@ -56,7 +63,10 @@ class EventsTable
|
||||
|
||||
public static function load_bettype_settings()
|
||||
{
|
||||
$res = BettypeUser::with('multiline_setting')->where('is_active', 1)->get();
|
||||
$res = BettypeUser::with('multiline_setting')
|
||||
->orderBy('multiline_setting_id')
|
||||
->where('is_active', 1)
|
||||
->get();
|
||||
|
||||
foreach ($res as $value) {
|
||||
self::$bettype_settings[] = $value->multiline_setting->table;
|
||||
@@ -107,6 +117,7 @@ class EventsTable
|
||||
TextColumn::make('away.name')
|
||||
->wrap()
|
||||
->searchable(),
|
||||
|
||||
ColumnMl::make('odds_2ways')->bookmakers(self::$multiline_gettype['odds_2ways'] ?? [])
|
||||
->visible(fn () => in_array('odds_2ways', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
@@ -125,8 +136,16 @@ class EventsTable
|
||||
->visible(fn () => in_array('odds_3ways', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->width(225)
|
||||
->alignCenter()
|
||||
->label('1X2'),
|
||||
|
||||
Column3wayHt::make('odds_3ways_ht')->bookmakers(self::$multiline_gettype['odds_3ways_ht'] ?? [])
|
||||
->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(225)
|
||||
->label('1X2 HT'),
|
||||
|
||||
ColumnTotal::make('odds_totals')->bookmakers(self::$multiline_gettype['odds_totals'] ?? [])
|
||||
->visible(fn () => in_array('odds_totals', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
@@ -134,6 +153,13 @@ class EventsTable
|
||||
->width(225)
|
||||
->label('Totals'),
|
||||
|
||||
ColumnTotalHt::make('odds_totals_ht')->bookmakers(self::$multiline_gettype['odds_totals_ht'] ?? [])
|
||||
->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(225)
|
||||
->label('Totals HT'),
|
||||
|
||||
ColumnTotalQ1::make('odds_totals_q1')->bookmakers(self::$multiline_gettype['odds_totals_q1'] ?? [])
|
||||
->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
@@ -191,7 +217,7 @@ class EventsTable
|
||||
->schema([
|
||||
Select::make(name: 'country_id')
|
||||
->placeholder('Country')
|
||||
->columnSpan(2)
|
||||
->columnSpan(4)
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->searchable()
|
||||
@@ -211,7 +237,7 @@ class EventsTable
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->multiple()
|
||||
->columnSpan(3)
|
||||
->columnSpan(6)
|
||||
->searchable()
|
||||
->options(function (Get $get) {
|
||||
if ($get('country_id')) {
|
||||
@@ -229,7 +255,7 @@ class EventsTable
|
||||
})
|
||||
->live(),
|
||||
DateRangePicker::make('starttime_period')
|
||||
->columnSpan(4)
|
||||
->columnSpan(8)
|
||||
->startPrefix('From')
|
||||
->displayFormat('d M Y')
|
||||
->minDate(now())
|
||||
@@ -279,7 +305,7 @@ class EventsTable
|
||||
}
|
||||
);
|
||||
})
|
||||
->columns(12)->columnSpan(12),
|
||||
->columns(19)->columnSpan(19),
|
||||
], layout: FiltersLayout::AboveContent)
|
||||
->filtersFormColumns(6)
|
||||
->deferFilters(false)
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class Column3wayHt extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column_3way_ht';
|
||||
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected $max;
|
||||
|
||||
protected $min;
|
||||
|
||||
protected $act;
|
||||
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
array_unshift($bookmakers, auth()->user()->bookmaker_id);
|
||||
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->has_data = count($record->odds_3ways_ht) ? true : false;
|
||||
|
||||
$this->act = $record->odds_3ways_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
|
||||
$this->max['h3w'] = $record->odds_3ways_ht->max('h3w');
|
||||
|
||||
$this->max['d3w'] = $record->odds_3ways_ht->max('d3w');
|
||||
|
||||
$this->max['a3w'] = $record->odds_3ways_ht->max('a3w');
|
||||
|
||||
$this->min['h3w'] = $record->odds_3ways_ht->min('h3w');
|
||||
|
||||
$this->min['d3w'] = $record->odds_3ways_ht->min('d3w');
|
||||
|
||||
$this->min['a3w'] = $record->odds_3ways_ht->min('a3w');
|
||||
}
|
||||
|
||||
public function getAct()
|
||||
{
|
||||
return $this->act;
|
||||
}
|
||||
|
||||
public function getMax()
|
||||
{
|
||||
return $this->max;
|
||||
}
|
||||
|
||||
public function getMin()
|
||||
{
|
||||
return $this->min;
|
||||
}
|
||||
|
||||
public function hasData()
|
||||
{
|
||||
return $this->has_data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class ColumnTotalHt extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-total-ht';
|
||||
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected $max;
|
||||
|
||||
protected $min;
|
||||
|
||||
protected $act;
|
||||
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
array_unshift($bookmakers, auth()->user()->bookmaker_id);
|
||||
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->has_data = count($record->odds_totals_ht) ? true : false;
|
||||
|
||||
$this->act = $record->odds_totals_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
|
||||
$this->max['over'] = $record->odds_totals_ht->max('over');
|
||||
|
||||
$this->max['under'] = $record->odds_totals_ht->max('under');
|
||||
|
||||
$this->min['over'] = $record->odds_totals_ht->min('over');
|
||||
|
||||
$this->min['under'] = $record->odds_totals_ht->min('under');
|
||||
|
||||
}
|
||||
|
||||
public function getAct()
|
||||
{
|
||||
return $this->act;
|
||||
}
|
||||
|
||||
public function getMax()
|
||||
{
|
||||
return $this->max;
|
||||
}
|
||||
|
||||
public function getMin()
|
||||
{
|
||||
return $this->min;
|
||||
}
|
||||
|
||||
public function hasData()
|
||||
{
|
||||
return $this->has_data;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user