From 7dce81013b9b823072ec580423bcf0dbbf31424e Mon Sep 17 00:00:00 2001 From: salam Date: Sun, 4 Jan 2026 09:51:35 +0100 Subject: [PATCH] wip --- app/Filament/Tables/Columns/Column3way.php | 13 +++++++++++++ .../filament/tables/columns/column_3way.blade.php | 11 +++++++---- .../tables/columns/multiline/odds.blade.php | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/app/Filament/Tables/Columns/Column3way.php b/app/Filament/Tables/Columns/Column3way.php index a12059a1..78ca883f 100644 --- a/app/Filament/Tables/Columns/Column3way.php +++ b/app/Filament/Tables/Columns/Column3way.php @@ -12,6 +12,8 @@ class Column3way extends Column protected ?array $min; + protected ?array $act; + protected ?array $bookmakers; protected ?bool $has_data; @@ -32,19 +34,30 @@ class Column3way extends Column { $this->max['h3w'] = $record->odds_3way->max('h3w'); $this->min['h3w'] = $record->odds_3way->min('h3w'); + $this->act['h3w'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id); $this->max['d3w'] = $record->odds_3way->max('d3w'); $this->min['d3w'] = $record->odds_3way->min('d3w'); + $this->act['d3w'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id)->get('d3w'); $this->max['a3w'] = $record->odds_3way->max('a3w'); $this->min['a3w'] = $record->odds_3way->min('a3w'); + $this->act['a3w'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id)->get('a3w'); $this->max['margin'] = $record->odds_3way->max('margin'); $this->min['margin'] = $record->odds_3way->min('margin'); + $this->act['margin'] = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id)->get('margin'); + + dd($this->act); $this->has_data = count($record->odds_3way) ? true : false; } + public function getAct() + { + return $this->act; + } + public function getMax() { return $this->max; diff --git a/resources/views/filament/tables/columns/column_3way.blade.php b/resources/views/filament/tables/columns/column_3way.blade.php index f991a6e6..a4494e36 100644 --- a/resources/views/filament/tables/columns/column_3way.blade.php +++ b/resources/views/filament/tables/columns/column_3way.blade.php @@ -22,7 +22,6 @@ 'decimal' => 2, 'max' => false, 'min' => false, - 'main' => true, ]) @include('filament.tables.columns.multiline.odds', [ @@ -30,7 +29,6 @@ 'decimal' => 2, 'max' => false, 'min' => false, - 'main' => true, ]) @include('filament.tables.columns.multiline.odds', [ @@ -38,7 +36,6 @@ 'decimal' => 2, 'max' => false, 'min' => false, - 'main' => true, ]) @include('filament.tables.columns.multiline.odds', [ @@ -46,11 +43,16 @@ 'decimal' => 1, 'max' => false, 'min' => false, - 'main' => true, ]) @endif @endforeach +
+ + @php + $act = $getAct(); + @endphp + @foreach ($getBookmaker() as $bookmaker_id) @foreach ($record->odds_3way as $item) @if ($item->bookmaker_id == $bookmaker_id) @@ -64,6 +66,7 @@ 'decimal' => 2, 'max' => false, 'min' => false, + 'over' => $item->d3w < $act['h3w'] ? 1 : 0, ]) @include('filament.tables.columns.multiline.odds', [ diff --git a/resources/views/filament/tables/columns/multiline/odds.blade.php b/resources/views/filament/tables/columns/multiline/odds.blade.php index 024812d5..98ee6ff4 100644 --- a/resources/views/filament/tables/columns/multiline/odds.blade.php +++ b/resources/views/filament/tables/columns/multiline/odds.blade.php @@ -1,7 +1,7 @@
  @if (isset($odd))