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,7 +2,6 @@
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use App\Models\OddsQualify;
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class ColumnTq extends Column
|
||||
@@ -13,8 +12,6 @@ class ColumnTq extends Column
|
||||
|
||||
protected ?array $min;
|
||||
|
||||
protected $data;
|
||||
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected ?bool $has_data;
|
||||
@@ -33,23 +30,16 @@ class ColumnTq extends Column
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->data = OddsQualify::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
$this->max['htq'] = $record->odds_tq->max('htq');
|
||||
$this->min['htq'] = $record->odds_tq->min('htq');
|
||||
|
||||
$this->max['htq'] = $this->data->max('htq');
|
||||
$this->min['htq'] = $this->data->min('htq');
|
||||
$this->max['atq'] = $record->odds_tq->max('atq');
|
||||
$this->min['atq'] = $record->odds_tq->min('atq');
|
||||
|
||||
$this->max['atq'] = $this->data->max('atq');
|
||||
$this->min['atq'] = $this->data->min('atq');
|
||||
$this->max['margin'] = $record->odds_tq->max('margin');
|
||||
$this->min['margin'] = $record->odds_tq->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_tq) ? true : false;
|
||||
}
|
||||
|
||||
public function getMax()
|
||||
|
||||
Reference in new issue
Block a user