db and query optimization compl

This commit is contained in:
salam committed 2026-01-04 06:29:11 +01:00
1 parent 9d2a8ce628
commit 40d97327d4
24 files changed
+145 -126

No files matched your search

+7 -17
View File
@@ -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()