tooltip final
This commit is contained in:
1 parent
c9588f39b6
commit
4ab4dcfd8c
19 files changed
+130
-220
No files matched your search
@@ -18,6 +18,7 @@ class Fixtures
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
$echo = Nuh::$options['e'] ?? 0;
|
||||
$break = Nuh::$options['b'] ?? 0;
|
||||
$week = Nuh::$options['w'] ?? 0;
|
||||
|
||||
$count = 0;
|
||||
$total = 0;
|
||||
@@ -101,6 +102,10 @@ class Fixtures
|
||||
if ($break) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ($week && $i == 7) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($debug) {
|
||||
Notice::note("Total - $total events processed", 'g');
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ use App\Models\MultilineSetting;
|
||||
use App\Models\User;
|
||||
use Livewire\Component;
|
||||
|
||||
class MonitorBettypeSwitch extends Component
|
||||
class BettypeToggle extends Component
|
||||
{
|
||||
public $multilines = [];
|
||||
|
||||
@@ -32,7 +32,7 @@ class MonitorBettypeSwitch extends Component
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.monitor-bettype-switch');
|
||||
return view('livewire.bettype-toggle');
|
||||
}
|
||||
|
||||
public function swopBettype($multiline_setting_id)
|
||||
@@ -41,4 +41,11 @@ class MonitorBettypeSwitch extends Component
|
||||
|
||||
$this->js('window.location.reload()');
|
||||
}
|
||||
|
||||
public function toggleBettype($sport, $bettype, $status)
|
||||
{
|
||||
User::where('id', auth()->user()->id)->update(["bettype_status->$sport->$bettype" => $status]);
|
||||
|
||||
$this->js('window.location.reload()');
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,10 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
protected $casts = [
|
||||
'bettype_status' => 'json',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
@@ -31,6 +35,7 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
||||
'password',
|
||||
'agb_akzeptiert',
|
||||
'app_verified_at',
|
||||
'bettype_status',
|
||||
'sport_id',
|
||||
];
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
FilamentView::registerRenderHook(
|
||||
TablesRenderHook::TOOLBAR_SEARCH_AFTER,
|
||||
fn (): string => Blade::render('@livewire(\'monitor-bettype-switch\')'),
|
||||
fn (): string => Blade::render('@livewire(\'bettype-toggle\')'),
|
||||
scopes: [
|
||||
ListEvents::class,
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user