wip filter

This commit is contained in:
salam committed 2026-01-10 13:17:09 +01:00
1 parent c4d7f2e6ee
commit d2caac4bcc
20 files changed
+567 -119

No files matched your search

@@ -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;
}
}