wip
This commit is contained in:
1 parent
7dce81013b
commit
668310b03d
12 files changed
+87
-124
No files matched your search
@@ -8,6 +8,8 @@ use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\SelectColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Columns\ToggleColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class SupervisorsTable
|
||||
@@ -42,8 +44,11 @@ class SupervisorsTable
|
||||
ToggleColumn::make('is_active')->label('On/Off'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
SelectFilter::make('provider_id')
|
||||
->relationship('provider', 'name')
|
||||
->label('Provider'),
|
||||
], layout: FiltersLayout::AboveContent)
|
||||
->deferFilters(false)
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
])
|
||||
|
||||
@@ -8,18 +8,14 @@ class Column3way extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column_3way';
|
||||
|
||||
protected ?array $max;
|
||||
|
||||
protected ?array $min;
|
||||
|
||||
protected ?array $act;
|
||||
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
array_unshift($bookmakers, auth()->user()->bookmaker_id);
|
||||
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
return $this;
|
||||
@@ -32,40 +28,23 @@ class Column3way extends Column
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->max['h3w'] = $record->odds_3way->max('h3w');
|
||||
$this->min['h3w'] = $record->odds_3way->min('h3w');
|
||||
$this->act['h3w'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id);
|
||||
|
||||
$this->max['d3w'] = $record->odds_3way->max('d3w');
|
||||
$this->min['d3w'] = $record->odds_3way->min('d3w');
|
||||
$this->act['d3w'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id)->get('d3w');
|
||||
|
||||
$this->max['a3w'] = $record->odds_3way->max('a3w');
|
||||
$this->min['a3w'] = $record->odds_3way->min('a3w');
|
||||
$this->act['a3w'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id)->get('a3w');
|
||||
|
||||
$this->max['margin'] = $record->odds_3way->max('margin');
|
||||
$this->min['margin'] = $record->odds_3way->min('margin');
|
||||
$this->act['margin'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id)->get('margin');
|
||||
|
||||
dd($this->act);
|
||||
|
||||
$this->has_data = count($record->odds_3way) ? true : false;
|
||||
}
|
||||
|
||||
public function getAct()
|
||||
{
|
||||
return $this->act;
|
||||
}
|
||||
$tmp = [];
|
||||
$tmp['max_h3w'] = $record->odds_3way->max('h3w');
|
||||
$tmp['min_h3w'] = $record->odds_3way->min('h3w');
|
||||
$tmp['max_d3w'] = $record->odds_3way->max('d3w');
|
||||
$tmp['min_d3w'] = $record->odds_3way->min('d3w');
|
||||
$tmp['max_a3w'] = $record->odds_3way->max('a3w');
|
||||
$tmp['min_a3w'] = $record->odds_3way->min('a3w');
|
||||
|
||||
public function getMax()
|
||||
{
|
||||
return $this->max;
|
||||
}
|
||||
|
||||
public function getMin()
|
||||
{
|
||||
return $this->min;
|
||||
foreach ($record->odds_3way as $key => $value) {
|
||||
if ($value->h3w == $tmp['max_h3w']) {
|
||||
$record->odds_3way->key->max_h3w = true;
|
||||
} else {
|
||||
$record->odds_3way->key->max_h3w = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function hasData()
|
||||
|
||||
Reference in new issue
Block a user