db and query optimization compl
This commit is contained in:
1 parent
9d2a8ce628
commit
40d97327d4
24 files changed
+145
-126
No files matched your search
@@ -2,15 +2,12 @@
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use App\Models\Odds3way;
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class Column3way extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column_3way';
|
||||
|
||||
protected $data;
|
||||
|
||||
protected ?array $max;
|
||||
|
||||
protected ?array $min;
|
||||
@@ -33,26 +30,19 @@ class Column3way extends Column
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->data = Odds3way::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
$this->max['h3w'] = $record->odds_3way->max('h3w');
|
||||
$this->min['h3w'] = $record->odds_3way->min('h3w');
|
||||
|
||||
$this->max['h3w'] = $this->data->max('h3w');
|
||||
$this->min['h3w'] = $this->data->min('h3w');
|
||||
$this->max['d3w'] = $record->odds_3way->max('d3w');
|
||||
$this->min['d3w'] = $record->odds_3way->min('d3w');
|
||||
|
||||
$this->max['d3w'] = $this->data->max('d3w');
|
||||
$this->min['d3w'] = $this->data->min('d3w');
|
||||
$this->max['a3w'] = $record->odds_3way->max('a3w');
|
||||
$this->min['a3w'] = $record->odds_3way->min('a3w');
|
||||
|
||||
$this->max['a3w'] = $this->data->max('a3w');
|
||||
$this->min['a3w'] = $this->data->min('a3w');
|
||||
$this->max['margin'] = $record->odds_3way->max('margin');
|
||||
$this->min['margin'] = $record->odds_3way->min('margin');
|
||||
|
||||
$this->max['margin'] = $this->data->max('margin');
|
||||
$this->min['margin'] = $this->data->min('margin');
|
||||
|
||||
$this->has_data = count($this->data) ? true : false;
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
return $this->data;
|
||||
$this->has_data = count($record->odds_3way) ? true : false;
|
||||
}
|
||||
|
||||
public function getMax()
|
||||
|
||||
Reference in new issue
Block a user