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