tooltip final

This commit is contained in:
salam committed 2025-12-23 12:43:06 +01:00
1 parent c9588f39b6
commit 4ab4dcfd8c
19 files changed
+130 -220

No files matched your search

@@ -58,7 +58,7 @@ class EventsTable
->alignRight(),
TextColumn::make('away.name')
->searchable(),
Columns3way::make('odds3way')->label(fn () => view('filament.tables.columns.multiline.label')),
Columns3way::make('odds3way')->label(fn () => view('filament.tables.columns.multiline.labels')),
])
->poll('10s')
->defaultSort('starttime', 'ASC')
+8 -23
View File
@@ -13,6 +13,8 @@ class Columns3way extends Column
protected ?array $fumetto;
protected ?bool $has_odds;
public function loadData($record, $multiline_client)
{
@@ -32,29 +34,7 @@ class Columns3way extends Column
}
}
// $this->multiline = [];
// foreach ($multiline_client as $slot => $bookmaker) {
// $open = true;
// foreach ($this->fumetto as $item) {
// if ($item['bookmaker_id'] == $bookmaker->bookmaker_id) {
// $this->multiline[$slot] = $item;
// $open = false;
// }
// }
// if ($open) {
// $item = new stdClass;
// $item['icon'] = $bookmaker->bookmaker->icon;
// $item['h3w'] = 0;
// $item['d3w'] = 0;
// $item['a3w'] = 0;
// $item['margin'] = 0;
// $item['bookmaker_id'] = $bookmaker->bookmaker_id;
// $this->multiline[$slot] = $item;
// }
// }
$this->has_odds = count($this->multiline) ? true : false;
}
public function getMultilines(): ?array
@@ -66,4 +46,9 @@ class Columns3way extends Column
{
return $this->fumetto;
}
public function hasodds()
{
return $this->has_odds;
}
}
@@ -1,70 +0,0 @@
<?php
namespace App\Filament\Tables\Columns;
use App\Models\Odds3way;
use App\Models\OddsDc;
use App\Models\OddsDnb;
use Filament\Tables\Columns\Column;
class MultilineColumn extends Column
{
protected string $view = 'filament.tables.columns.multiline.main';
protected ?array $fumetto;
protected ?array $settings;
public function has3Columns(): ?int
{
return $this->settings->has_3_columns;
}
public function getFumetto()
{
return $this->fumetto;
}
public function laodFumetto($event_id)
{
$systemSettings = app('systemSettings');
$this->settings = $systemSettings[auth()->user()->multiline_setting_id];
switch ($this->settings->table) {
case 'odds_2ways':
$this->fumetto = Odds2way::with('bookmaker')->where('event_id', $event_id)->get();
break;
case 'odds_2ways_s1':
$this->fumetto = Odds2wayS1::with('bookmaker')->where('event_id', $event_id)->get();
break;
case 'odds_3ways':
$this->fumetto = Odds3way::with('bookmaker')->where('event_id', $event_id)->get();
break;
case 'odds_dc':
$this->fumetto = OddsDc::with('bookmaker')->where('event_id', $event_id)->get();
break;
case 'odds_dnb':
$this->fumetto = OddsDnb::with('bookmaker')->where('event_id', $event_id)->get();
break;
case 'odds_ggng':
$this->fumetto = OddsGgng::with('bookmaker')->where('event_id', $event_id)->get();
break;
case 'odds_handicaps':
$this->fumetto = OddsHandicap::with('bookmaker')->where('event_id', $event_id)->get();
break;
case 'odds_handicaps_q1':
$this->fumetto = OddsHandicapQ1::with('bookmaker')->where('event_id', $event_id)->get();
break;
case 'odds_qualify':
$this->fumetto = OddsQualify::with('bookmaker')->where('event_id', $event_id)->get();
break;
case 'odds_totals':
$this->fumetto = OddsTotal::with('bookmaker')->where('event_id', $event_id)->get();
break;
case 'odds_totals_q1':
$this->fumetto = OddsTotalQ1::with('bookmaker')->where('event_id', $event_id)->get();
break;
}
}
}