This commit is contained in:
salam committed 2026-01-27 09:07:31 +01:00
1 parent 0742b6c19f
commit ec6d4863a9
3 files changed
+30 -36

No files matched your search

+24 -15
View File
@@ -4,6 +4,7 @@ namespace App\Filament\Tables\Columns;
use App\Utilities\BkmIconMap; use App\Utilities\BkmIconMap;
use Filament\Tables\Columns\Column; use Filament\Tables\Columns\Column;
use Illuminate\Support\Carbon;
class TooltipOdds extends Column class TooltipOdds extends Column
{ {
@@ -143,12 +144,18 @@ class TooltipOdds extends Column
public function makeTooltip() public function makeTooltip()
{ {
foreach ($this->data as $k => $value) { foreach ($this->data as $k => $value) {
$this->pop .= $this->getIcon($value);
$this->getIcon($value);
foreach ($this->oddnames as $oddname) { foreach ($this->oddnames as $oddname) {
$this->pop .= $this->getOdd($value[$oddname], $oddname); $this->getOdd($value[$oddname], $oddname);
} }
$this->pop .= $this->getMargin($value->margin); $this->getMargin($value->margin);
$this->pop .= $this->getFlags($value->flags);
$this->getUpdatedAt($value->updated_at);
$this->getFlags($value->flags);
if ($k % 2 == 0 && $this->size > $this->two_cols_break) { if ($k % 2 == 0 && $this->size > $this->two_cols_break) {
$this->pop .= '<div></div>'; $this->pop .= '<div></div>';
} }
@@ -163,9 +170,7 @@ class TooltipOdds extends Column
public function getOdd($odd, $name) public function getOdd($odd, $name)
{ {
if (in_array($name, ['handicap', 'total'])) { if ($odd == $this->max[$name]) {
$str = '<div class="mb-0.5 ml-0.5">';
} elseif ($odd == $this->max[$name]) {
$str = '<div class="mb-0.5 ml-0.5 bg-green-600/25 rounded shadow">'; $str = '<div class="mb-0.5 ml-0.5 bg-green-600/25 rounded shadow">';
} elseif ($odd == $this->min[$name]) { } elseif ($odd == $this->min[$name]) {
$str = '<div class="mb-0.5 ml-0.5 bg-blue-600/25 rounded shadow">'; $str = '<div class="mb-0.5 ml-0.5 bg-blue-600/25 rounded shadow">';
@@ -177,19 +182,23 @@ class TooltipOdds extends Column
public function getMargin($odd) public function getMargin($odd)
{ {
$str = '<div class="mb-0.5 ml-0.5">'; $this->pop .= '<div class="mb-0.5 ml-0.5">'.number_format($odd, 1).'</div>';
$this->pop .= $str.number_format($odd, 1).'</div>';
} }
public function getFlags($flags) public function getFlags($flags)
{ {
if ($flags) { if ($flags) {
$this->pop .= '<div></div>'; $this->pop .= '<div class="pb-0.5 text-green-600">&check;</div>';
} else { } else {
$this->pop .= '<div><x-filament::icon-button icon="heroicon-m-exclamation-triangle" color="info" /></div>'; $this->pop .= '<div class="pb-0.5 text-info-600">&#9888;</div>';
} }
} }
public function getUpdatedAt($updated_at)
{
$this->pop .= '<div class="text-xs text-nowrap">'.Carbon::createFromDate($updated_at)->format('H:i').'</div>';
}
public function makeHeader() public function makeHeader()
{ {
@@ -244,15 +253,15 @@ class TooltipOdds extends Column
if ($this->size > $this->two_cols_break) { if ($this->size > $this->two_cols_break) {
if ($columns == 6) { if ($columns == 6) {
$this->pop = '<div class="grid grid-cols-13 gap-2 m-5 z-100 text-xs text-center">'; $this->pop = '<div class="grid grid-cols-14 gap-2 m-5 z-100 text-xs text-center">';
} else { } else {
$this->pop = '<div class="grid grid-cols-11 gap-2 m-5 z-100 text-xs text-center">'; $this->pop = '<div class="grid grid-cols-12 gap-2 m-5 z-100 text-xs text-center">';
} }
} else { } else {
if ($columns == 6) { if ($columns == 6) {
$this->pop = '<div class="grid grid-cols-6 gap-2 m-5 z-100 text-xs text-center">'; $this->pop = '<div class="grid grid-cols-7 gap-2 m-5 z-100 text-xs text-center">';
} else { } else {
$this->pop = '<div class="grid grid-cols-5 gap-2 m-5 z-100 text-xs text-center">'; $this->pop = '<div class="grid grid-cols-6 gap-2 m-5 z-100 text-xs text-center">';
} }
} }
$this->pop .= '<div class="col-span-full text-center text-md font-bold mb-2">'.$title.'</div>'; $this->pop .= '<div class="col-span-full text-center text-md font-bold mb-2">'.$title.'</div>';
Generated
+3 -3
View File
@@ -12814,12 +12814,12 @@
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": {},
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^8.3" "php": "^8.3"
}, },
"platform-dev": [], "platform-dev": {},
"plugin-api-version": "2.6.0" "plugin-api-version": "2.9.0"
} }
@@ -9,7 +9,6 @@
]) ])
@switch ($getBettype()) @switch ($getBettype())
@case ('odds_tq') @case ('odds_tq')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->htq, 'odd' => $client->htq,
@@ -22,7 +21,6 @@
'd' => 2, 'd' => 2,
]) ])
@break; @break;
@case ('odds_2ways') @case ('odds_2ways')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->h2w, 'odd' => $client->h2w,
@@ -35,7 +33,6 @@
'd' => 2, 'd' => 2,
]) ])
@break; @break;
@case ('odds_2ways_s1') @case ('odds_2ways_s1')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->h2w, 'odd' => $client->h2w,
@@ -48,7 +45,6 @@
'd' => 2, 'd' => 2,
]) ])
@break; @break;
@case ('odds_3ways') @case ('odds_3ways')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->h3w, 'odd' => $client->h3w,
@@ -66,7 +62,6 @@
'd' => 2, 'd' => 2,
]) ])
@break; @break;
@case ('odds_3ways_ht') @case ('odds_3ways_ht')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->h3w, 'odd' => $client->h3w,
@@ -84,7 +79,6 @@
'd' => 2, 'd' => 2,
]) ])
@break; @break;
@case ('odds_dc') @case ('odds_dc')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->dc1x, 'odd' => $client->dc1x,
@@ -102,7 +96,6 @@
'd' => 2, 'd' => 2,
]) ])
@break; @break;
@case ('odds_dnb') @case ('odds_dnb')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->dnb1, 'odd' => $client->dnb1,
@@ -115,7 +108,6 @@
'd' => 2, 'd' => 2,
]) ])
@break; @break;
@case ('odds_ggng') @case ('odds_ggng')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->gg, 'odd' => $client->gg,
@@ -128,7 +120,6 @@
'd' => 2, 'd' => 2,
]) ])
@break; @break;
@case ('odds_points') @case ('odds_points')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->home, 'odd' => $client->home,
@@ -146,7 +137,6 @@
'd' => 1, 'd' => 1,
]) ])
@break; @break;
@case ('odds_points_ht') @case ('odds_points_ht')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->home, 'odd' => $client->home,
@@ -164,7 +154,6 @@
'd' => 1, 'd' => 1,
]) ])
@break; @break;
@case ('odds_points_q1') @case ('odds_points_q1')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->home, 'odd' => $client->home,
@@ -182,7 +171,6 @@
'd' => 1, 'd' => 1,
]) ])
@break; @break;
@case ('odds_totals') @case ('odds_totals')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->over, 'odd' => $client->over,
@@ -200,7 +188,6 @@
'd' => 1, 'd' => 1,
]) ])
@break; @break;
@case ('odds_totals_ht') @case ('odds_totals_ht')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->over, 'odd' => $client->over,
@@ -218,7 +205,6 @@
'd' => 1, 'd' => 1,
]) ])
@break; @break;
@case ('odds_totals_q1') @case ('odds_totals_q1')
@include('filament.tables.columns.multiline.odd-compare', [ @include('filament.tables.columns.multiline.odd-compare', [
'odd' => $client->over, 'odd' => $client->over,
@@ -236,7 +222,6 @@
'd' => 1, 'd' => 1,
]) ])
@break; @break;
@endswitch @endswitch
@@ -246,11 +231,11 @@
'd' => 1, 'd' => 1,
]) ])
@else @else
@include('filament.tables.columns.multiline.bkm', [ {{-- @include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => auth()->user()->bookmaker_id, 'bookmaker_id' => auth()->user()->bookmaker_id,
'icon' => auth()->user()->bookmaker->icon ?? '', 'icon' => auth()->user()->bookmaker->icon ?? '',
]) ]) --}}
{{-- <div>&nbsp;</div> --}} <div>&nbsp;</div>
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>