59 lines
1.1 KiB
PHP
59 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Tables\Columns;
|
|
|
|
use Filament\Tables\Columns\Column;
|
|
|
|
class PopupOdds extends Column
|
|
{
|
|
protected string $view = 'filament.tables.columns.popup-odds';
|
|
|
|
protected $max;
|
|
|
|
protected $min;
|
|
|
|
protected $act;
|
|
|
|
protected ?int $has_data;
|
|
|
|
public function loadData($record)
|
|
{
|
|
$this->has_data = count($record->odds_3ways);
|
|
|
|
$this->act = $record->odds_3ways->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
|
|
|
$this->max['h3w'] = $record->odds_3ways->max('h3w');
|
|
|
|
$this->max['d3w'] = $record->odds_3ways->max('d3w');
|
|
|
|
$this->max['a3w'] = $record->odds_3ways->max('a3w');
|
|
|
|
$this->min['h3w'] = $record->odds_3ways->min('h3w');
|
|
|
|
$this->min['d3w'] = $record->odds_3ways->min('d3w');
|
|
|
|
$this->min['a3w'] = $record->odds_3ways->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;
|
|
}
|
|
}
|