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 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 .= '<div></div>';
}
@@ -163,9 +170,7 @@ class TooltipOdds extends Column
public function getOdd($odd, $name)
{
if (in_array($name, ['handicap', 'total'])) {
$str = '<div class="mb-0.5 ml-0.5">';
} elseif ($odd == $this->max[$name]) {
if ($odd == $this->max[$name]) {
$str = '<div class="mb-0.5 ml-0.5 bg-green-600/25 rounded shadow">';
} elseif ($odd == $this->min[$name]) {
$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)
{
$str = '<div class="mb-0.5 ml-0.5">';
$this->pop .= $str.number_format($odd, 1).'</div>';
$this->pop .= '<div class="mb-0.5 ml-0.5">'.number_format($odd, 1).'</div>';
}
public function getFlags($flags)
{
if ($flags) {
$this->pop .= '<div></div>';
$this->pop .= '<div class="pb-0.5 text-green-600">&check;</div>';
} 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()
{
@@ -244,15 +253,15 @@ class TooltipOdds extends Column
if ($this->size > $this->two_cols_break) {
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 {
$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 {
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 {
$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>';
Generated
+3 -3
View File
@@ -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"
}
@@ -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 ?? '',
])
{{-- <div>&nbsp;</div> --}}
]) --}}
<div>&nbsp;</div>
<div></div>
<div></div>
<div></div>