From ec6d4863a9cdcc74b2bda38df4f08b59ac2a1c0b Mon Sep 17 00:00:00 2001 From: salam Date: Tue, 27 Jan 2026 09:07:31 +0100 Subject: [PATCH] wip --- app/Filament/Tables/Columns/TooltipOdds.php | 39 ++++++++++++------- composer.lock | 6 +-- .../multiline/multiline-client.blade.php | 21 ++-------- 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/app/Filament/Tables/Columns/TooltipOdds.php b/app/Filament/Tables/Columns/TooltipOdds.php index cc4fad24..882c4f67 100644 --- a/app/Filament/Tables/Columns/TooltipOdds.php +++ b/app/Filament/Tables/Columns/TooltipOdds.php @@ -4,6 +4,7 @@ namespace App\Filament\Tables\Columns; use App\Utilities\BkmIconMap; use Filament\Tables\Columns\Column; +use Illuminate\Support\Carbon; class TooltipOdds extends Column { @@ -143,12 +144,18 @@ class TooltipOdds extends Column public function makeTooltip() { foreach ($this->data as $k => $value) { - $this->pop .= $this->getIcon($value); + + $this->getIcon($value); + foreach ($this->oddnames as $oddname) { - $this->pop .= $this->getOdd($value[$oddname], $oddname); + $this->getOdd($value[$oddname], $oddname); } - $this->pop .= $this->getMargin($value->margin); - $this->pop .= $this->getFlags($value->flags); + $this->getMargin($value->margin); + + $this->getUpdatedAt($value->updated_at); + + $this->getFlags($value->flags); + if ($k % 2 == 0 && $this->size > $this->two_cols_break) { $this->pop .= '
'; } @@ -163,9 +170,7 @@ class TooltipOdds extends Column public function getOdd($odd, $name) { - if (in_array($name, ['handicap', 'total'])) { - $str = '
'; - } elseif ($odd == $this->max[$name]) { + if ($odd == $this->max[$name]) { $str = '
'; } elseif ($odd == $this->min[$name]) { $str = '
'; @@ -177,19 +182,23 @@ class TooltipOdds extends Column public function getMargin($odd) { - $str = '
'; - $this->pop .= $str.number_format($odd, 1).'
'; + $this->pop .= '
'.number_format($odd, 1).'
'; } public function getFlags($flags) { if ($flags) { - $this->pop .= '
'; + $this->pop .= '
✓
'; } else { - $this->pop .= '
'; + $this->pop .= '
⚠
'; } } + public function getUpdatedAt($updated_at) + { + $this->pop .= '
'.Carbon::createFromDate($updated_at)->format('H:i').'
'; + } + public function makeHeader() { @@ -244,15 +253,15 @@ class TooltipOdds extends Column if ($this->size > $this->two_cols_break) { if ($columns == 6) { - $this->pop = '
'; + $this->pop = '
'; } else { - $this->pop = '
'; + $this->pop = '
'; } } else { if ($columns == 6) { - $this->pop = '
'; + $this->pop = '
'; } else { - $this->pop = '
'; + $this->pop = '
'; } } $this->pop .= '
'.$title.'
'; diff --git a/composer.lock b/composer.lock index 3e630d95..0d0dcf1a 100644 --- a/composer.lock +++ b/composer.lock @@ -12814,12 +12814,12 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^8.3" }, - "platform-dev": [], - "plugin-api-version": "2.6.0" + "platform-dev": {}, + "plugin-api-version": "2.9.0" } diff --git a/resources/views/filament/tables/columns/multiline/multiline-client.blade.php b/resources/views/filament/tables/columns/multiline/multiline-client.blade.php index 8b0e20d5..b864de14 100644 --- a/resources/views/filament/tables/columns/multiline/multiline-client.blade.php +++ b/resources/views/filament/tables/columns/multiline/multiline-client.blade.php @@ -9,7 +9,6 @@ ]) @switch ($getBettype()) - @case ('odds_tq') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->htq, @@ -22,7 +21,6 @@ 'd' => 2, ]) @break; - @case ('odds_2ways') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->h2w, @@ -35,7 +33,6 @@ 'd' => 2, ]) @break; - @case ('odds_2ways_s1') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->h2w, @@ -48,7 +45,6 @@ 'd' => 2, ]) @break; - @case ('odds_3ways') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->h3w, @@ -66,7 +62,6 @@ 'd' => 2, ]) @break; - @case ('odds_3ways_ht') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->h3w, @@ -84,7 +79,6 @@ 'd' => 2, ]) @break; - @case ('odds_dc') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->dc1x, @@ -102,7 +96,6 @@ 'd' => 2, ]) @break; - @case ('odds_dnb') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->dnb1, @@ -115,7 +108,6 @@ 'd' => 2, ]) @break; - @case ('odds_ggng') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->gg, @@ -128,7 +120,6 @@ 'd' => 2, ]) @break; - @case ('odds_points') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->home, @@ -146,7 +137,6 @@ 'd' => 1, ]) @break; - @case ('odds_points_ht') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->home, @@ -164,7 +154,6 @@ 'd' => 1, ]) @break; - @case ('odds_points_q1') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->home, @@ -182,7 +171,6 @@ 'd' => 1, ]) @break; - @case ('odds_totals') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->over, @@ -200,7 +188,6 @@ 'd' => 1, ]) @break; - @case ('odds_totals_ht') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->over, @@ -218,7 +205,6 @@ 'd' => 1, ]) @break; - @case ('odds_totals_q1') @include('filament.tables.columns.multiline.odd-compare', [ 'odd' => $client->over, @@ -236,7 +222,6 @@ 'd' => 1, ]) @break; - @endswitch @@ -246,11 +231,11 @@ 'd' => 1, ]) @else - @include('filament.tables.columns.multiline.bkm', [ + {{-- @include('filament.tables.columns.multiline.bkm', [ 'bookmaker_id' => auth()->user()->bookmaker_id, 'icon' => auth()->user()->bookmaker->icon ?? '', - ]) - {{--
 
--}} + ]) --}} +