From 0cf815c00fe70a03e54452c9ac58aa2a3cd163b7 Mon Sep 17 00:00:00 2001 From: salam Date: Sun, 25 Jan 2026 08:45:42 +0100 Subject: [PATCH] wip --- app/Console/Commands/Grapper/TxOdds/Odds.php | 20 +- app/Console/Commands/Nuh.php | 4 +- .../Resources/Events/Tables/EventsTable.php | 65 ++-- .../Tables/Tools/LoadBettypeSettings.php | 3 +- .../Events/Tables/Tools/LoadMultiline.php | 61 ++++ .../Tables/Tools/LoadMultilineBookmaker.php | 66 ---- app/Filament/Tables/Columns/Column3way.php | 78 ----- app/Filament/Tables/Columns/Column3wayHt.php | 78 ----- app/Filament/Tables/Columns/ColumnDc.php | 78 ----- app/Filament/Tables/Columns/ColumnDnb.php | 75 ----- app/Filament/Tables/Columns/ColumnGgng.php | 74 ----- app/Filament/Tables/Columns/ColumnMl.php | 74 ----- app/Filament/Tables/Columns/ColumnMlS1.php | 75 ----- app/Filament/Tables/Columns/ColumnOdds.php | 290 ++++++++++++++++++ app/Filament/Tables/Columns/ColumnPoint.php | 75 ----- app/Filament/Tables/Columns/ColumnPointQ1.php | 75 ----- app/Filament/Tables/Columns/ColumnTotal.php | 75 ----- app/Filament/Tables/Columns/ColumnTotalHt.php | 75 ----- app/Filament/Tables/Columns/ColumnTotalQ1.php | 75 ----- app/Filament/Tables/Columns/ColumnTq.php | 75 ----- app/Filament/Tables/Columns/FilterOdds.php | 65 ++-- app/Filament/Tables/Columns/TooltipOdds.php | 4 +- .../tables/columns/column-dc.blade.php | 50 --- .../tables/columns/column-dnb.blade.php | 43 --- .../tables/columns/column-ggng.blade.php | 43 --- .../tables/columns/column-ml-s1.blade.php | 43 --- .../tables/columns/column-ml.blade.php | 43 --- .../tables/columns/column-odds.blade.php | 137 +++++++++ .../tables/columns/column-point-q1.blade.php | 49 --- .../tables/columns/column-point.blade.php | 49 --- .../tables/columns/column-total-ht.blade.php | 49 --- .../tables/columns/column-total-q1.blade.php | 49 --- .../tables/columns/column-total.blade.php | 49 --- .../tables/columns/column-tq.blade.php | 42 --- .../tables/columns/column_3way.blade.php | 55 ---- .../tables/columns/column_3way_ht.blade.php | 50 --- .../tables/columns/multiline/odd.blade.php | 10 + .../tables/columns/multiline/odds.blade.php | 14 - .../tables/columns/multiline/spread.blade.php | 7 + 39 files changed, 582 insertions(+), 1760 deletions(-) create mode 100644 app/Filament/Resources/Events/Tables/Tools/LoadMultiline.php delete mode 100644 app/Filament/Resources/Events/Tables/Tools/LoadMultilineBookmaker.php delete mode 100644 app/Filament/Tables/Columns/Column3way.php delete mode 100644 app/Filament/Tables/Columns/Column3wayHt.php delete mode 100644 app/Filament/Tables/Columns/ColumnDc.php delete mode 100644 app/Filament/Tables/Columns/ColumnDnb.php delete mode 100644 app/Filament/Tables/Columns/ColumnGgng.php delete mode 100644 app/Filament/Tables/Columns/ColumnMl.php delete mode 100644 app/Filament/Tables/Columns/ColumnMlS1.php create mode 100644 app/Filament/Tables/Columns/ColumnOdds.php delete mode 100644 app/Filament/Tables/Columns/ColumnPoint.php delete mode 100644 app/Filament/Tables/Columns/ColumnPointQ1.php delete mode 100644 app/Filament/Tables/Columns/ColumnTotal.php delete mode 100644 app/Filament/Tables/Columns/ColumnTotalHt.php delete mode 100644 app/Filament/Tables/Columns/ColumnTotalQ1.php delete mode 100644 app/Filament/Tables/Columns/ColumnTq.php delete mode 100644 resources/views/filament/tables/columns/column-dc.blade.php delete mode 100644 resources/views/filament/tables/columns/column-dnb.blade.php delete mode 100644 resources/views/filament/tables/columns/column-ggng.blade.php delete mode 100644 resources/views/filament/tables/columns/column-ml-s1.blade.php delete mode 100644 resources/views/filament/tables/columns/column-ml.blade.php create mode 100644 resources/views/filament/tables/columns/column-odds.blade.php delete mode 100644 resources/views/filament/tables/columns/column-point-q1.blade.php delete mode 100644 resources/views/filament/tables/columns/column-point.blade.php delete mode 100644 resources/views/filament/tables/columns/column-total-ht.blade.php delete mode 100644 resources/views/filament/tables/columns/column-total-q1.blade.php delete mode 100644 resources/views/filament/tables/columns/column-total.blade.php delete mode 100644 resources/views/filament/tables/columns/column-tq.blade.php delete mode 100644 resources/views/filament/tables/columns/column_3way.blade.php delete mode 100644 resources/views/filament/tables/columns/column_3way_ht.blade.php create mode 100644 resources/views/filament/tables/columns/multiline/odd.blade.php delete mode 100644 resources/views/filament/tables/columns/multiline/odds.blade.php create mode 100644 resources/views/filament/tables/columns/multiline/spread.blade.php diff --git a/app/Console/Commands/Grapper/TxOdds/Odds.php b/app/Console/Commands/Grapper/TxOdds/Odds.php index e215013c..9ed3f1a6 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds.php @@ -114,7 +114,7 @@ class Odds $_calls[] = $url.$markets.$id; - } elseif (Nuh::$options['g']) { + } elseif (Nuh::$options['gid']) { /************************************************* * BY GROUP ID @@ -125,11 +125,27 @@ class Odds $from_to = '&days='.Nuh::$options['days_from'].','.Nuh::$options['days_to']; - $events = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->where('group_id', Nuh::$options['g'])->pluck('id'); + $events = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->where('group_id', Nuh::$options['gid'])->pluck('id'); foreach ($events as $event_id) { $_calls[] = $url.$markets.$from_to.'&peid='.$event_id; } + } elseif (Nuh::$options['g']) { + + /************************************************* + * ALL BY GROUP ID for last changes + *************************************************/ + if ($debug) { + Notice::note("GROUP_ID \nsport_id: ".Nuh::$options['sport_id'], 'p'); + } + + $from_to = '&days='.Nuh::$options['days_from'].','.Nuh::$options['days_to']; + + $groupids = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->groupBy('group_id')->pluck('group_id'); + + foreach ($groupids as $groupid) { + $_calls[] = $url.$markets.$from_to.'&pgid='.$groupid; + } } elseif (Nuh::$options['t']) { diff --git a/app/Console/Commands/Nuh.php b/app/Console/Commands/Nuh.php index b84ebf17..a1fd947a 100644 --- a/app/Console/Commands/Nuh.php +++ b/app/Console/Commands/Nuh.php @@ -21,7 +21,7 @@ class Nuh extends Command public static $id = 0; - protected $signature = 'nuh {process=help} {--id=0} {--fn=} {--g=} {--p} {--d} {--x} {--t} {--w} {--a} {--r} {--s} {--t} {--q} {--f}'; + protected $signature = 'nuh {process=help} {--id=0} {--fn=} {--gid=} {--p} {--d} {--x} {--t} {--w} {--a} {--r} {--s} {--g} {--t} {--q} {--f}'; public function handle() { @@ -37,7 +37,7 @@ class Nuh extends Command $txt .= 'process [id] (required)'.PHP_EOL; $txt .= '--id=matchid (optional) calling spezific id'.PHP_EOL; $txt .= '--fn=name (optional) [bkms, markets]'.PHP_EOL; - $txt .= '--g=groupid (optional) [bkms, groupid]'.PHP_EOL; + $txt .= '--gid=groupid (optional) [bkms, groupid]'.PHP_EOL; $txt .= '----------------------------------------------'.PHP_EOL.PHP_EOL; $txt .= 'Options'.PHP_EOL; $txt .= '----------------------------------------------'.PHP_EOL; diff --git a/app/Filament/Resources/Events/Tables/EventsTable.php b/app/Filament/Resources/Events/Tables/EventsTable.php index b1e6ae69..f57ec78b 100644 --- a/app/Filament/Resources/Events/Tables/EventsTable.php +++ b/app/Filament/Resources/Events/Tables/EventsTable.php @@ -3,20 +3,8 @@ namespace App\Filament\Resources\Events\Tables; use App\Filament\Resources\Events\Tables\Tools\LoadBettypeSettings; -use App\Filament\Resources\Events\Tables\Tools\LoadMultilineBookmaker; -use App\Filament\Tables\Columns\Column3way; -use App\Filament\Tables\Columns\Column3wayHt; -use App\Filament\Tables\Columns\ColumnDc; -use App\Filament\Tables\Columns\ColumnDnb; -use App\Filament\Tables\Columns\ColumnGgng; -use App\Filament\Tables\Columns\ColumnMl; -use App\Filament\Tables\Columns\ColumnMlS1; -use App\Filament\Tables\Columns\ColumnPoint; -use App\Filament\Tables\Columns\ColumnPointQ1; -use App\Filament\Tables\Columns\ColumnTotal; -use App\Filament\Tables\Columns\ColumnTotalHt; -use App\Filament\Tables\Columns\ColumnTotalQ1; -use App\Filament\Tables\Columns\ColumnTq; +use App\Filament\Resources\Events\Tables\Tools\LoadMultiline; +use App\Filament\Tables\Columns\ColumnOdds; use App\Filament\Tables\Columns\EventColumn; use App\Filament\Tables\Columns\MatchIds; use App\Filament\Tables\Columns\TooltipOdds; @@ -52,18 +40,20 @@ class EventsTable public static $bettype_settings; - public static $multiline_bookmaker; + public static $slots; + + public static $filter; public static function configure(Table $table): Table { self::$user = User::getUser(); - self::$bettype_settings = LoadBettypeSettings::load(); + LoadBettypeSettings::load(); - self::$multiline_bookmaker = LoadMultilineBookmaker::load(); + LoadMultiline::load(); return $table - ->poll('10s') + // ->poll('10s') ->striped() ->deferLoading() ->defaultPaginationPageOption(5) @@ -93,94 +83,83 @@ class EventsTable EventColumn::make('event'), TooltipOdds::make('ml')->bettype('odds_2ways')->label('')->visible(fn () => in_array('odds_2ways', self::$bettype_settings)), - ColumnMl::make('odds_2ways')->bookmakers(self::$multiline_bookmaker['odds_2ways'] ?? []) + ColumnOdds::make('odds_2ways')->bettype('odds_2ways') ->visible(fn () => in_array('odds_2ways', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('ML'), TooltipOdds::make('mls1')->bettype('odds_2ways_s1')->label('')->visible(fn () => in_array('odds_2ways_s1', self::$bettype_settings)), - ColumnMlS1::make('odds_2ways_s1')->bookmakers(self::$multiline_bookmaker['odds_2ways'] ?? []) + ColumnOdds::make('odds_2ways_s1')->bettype('odds_2ways_s1') ->visible(fn () => in_array('odds_2ways_s1', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('ML S1'), TooltipOdds::make('1x2')->bettype('odds_3ways')->label('')->visible(fn () => in_array('odds_3ways', self::$bettype_settings)), - Column3way::make('odds_3ways')->bookmakers(self::$multiline_bookmaker['odds_3ways'] ?? []) + ColumnOdds::make('odds_3ways')->bettype('odds_3ways') ->visible(fn () => in_array('odds_3ways', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('1X2'), TooltipOdds::make('total')->bettype('odds_totals')->label('')->visible(fn () => in_array('odds_totals', self::$bettype_settings)), - ColumnTotal::make('odds_totals')->bookmakers(self::$multiline_bookmaker['odds_totals'] ?? []) + ColumnOdds::make('odds_totals')->bettype('odds_totals') ->visible(fn () => in_array('odds_totals', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('Totals'), TooltipOdds::make('1x2ht')->bettype('odds_3ways_ht')->label('')->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings)), - Column3wayHt::make('odds_3ways_ht')->bookmakers(self::$multiline_bookmaker['odds_3ways_ht'] ?? []) + ColumnOdds::make('odds_3ways_ht')->bettype('odds_3ways_ht') ->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('1X2 HT'), TooltipOdds::make('total_ht')->bettype('odds_totals_ht')->label('')->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings)), - ColumnTotalHt::make('odds_totals_ht')->bookmakers(self::$multiline_bookmaker['odds_totals_ht'] ?? []) + ColumnOdds::make('odds_totals_ht')->bettype('odds_totals_ht') ->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('Totals HT'), TooltipOdds::make('ggng')->bettype('odds_ggng')->label('')->visible(fn () => in_array('odds_ggng', self::$bettype_settings)), - ColumnGgng::make('odds_ggng')->bookmakers(self::$multiline_bookmaker['odds_ggng'] ?? []) + ColumnOdds::make('odds_ggng')->bettype('odds_ggng') ->visible(fn () => \in_array('odds_ggng', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('Goal No Goal'), TooltipOdds::make('points')->bettype('odds_points')->label('')->visible(fn () => in_array('odds_points', self::$bettype_settings)), - ColumnPoint::make('odds_points')->bookmakers(self::$multiline_bookmaker['odds_points'] ?? []) + ColumnOdds::make('odds_points')->bettype('odds_points') + ->width(240) ->visible(fn () => in_array('odds_points', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) ->alignCenter() ->label('Points'), TooltipOdds::make('total_q1')->bettype('odds_totals_q1')->label('')->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings)), - ColumnTotalQ1::make('odds_totals_q1')->bookmakers(self::$multiline_bookmaker['odds_totals_q1'] ?? []) + ColumnOdds::make('odds_totals_q1')->bettype('odds_totals_q1') ->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('Totals Q1'), TooltipOdds::make('points_q1')->bettype('odds_points_q1')->label('')->visible(fn () => in_array('odds_points_q1', self::$bettype_settings)), - ColumnPointQ1::make('odds_points_q1')->bookmakers(self::$multiline_bookmaker['odds_points_q1'] ?? []) + ColumnOdds::make('odds_points_q1')->bettype('odds_points_q1') ->visible(fn () => in_array('odds_points_q1', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('Points Q1'), TooltipOdds::make('dc')->bettype('odds_dc')->label('')->visible(fn () => in_array('odds_dc', self::$bettype_settings)), - ColumnDc::make('odds_dc')->bookmakers(self::$multiline_bookmaker['odds_dc'] ?? []) + ColumnOdds::make('odds_dc')->bettype('odds_dc') ->visible(fn () => \in_array('odds_dc', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('Double Chance'), TooltipOdds::make('tq')->bettype('odds_tq')->label('')->visible(fn () => in_array('odds_tq', self::$bettype_settings)), - ColumnTq::make('odds_tq')->bookmakers(self::$multiline_bookmaker['odds_tq'] ?? []) + ColumnOdds::make('odds_tq')->bettype('odds_tq') ->visible(fn () => \in_array('odds_tq', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('To Qualify'), TooltipOdds::make('dnb')->bettype('odds_dnb')->label('')->visible(fn () => in_array('odds_dnb', self::$bettype_settings)), - ColumnDnb::make('odds_dnb')->bookmakers(self::$multiline_bookmaker['odds_dnb'] ?? []) + ColumnOdds::make('odds_dnb')->bettype('odds_dnb') ->visible(fn () => \in_array('odds_dnb', self::$bettype_settings)) ->verticalAlignment(VerticalAlignment::Start) - ->alignCenter() ->label('Draw No Bet'), ])->searchable(['id', 'home.name', 'away.name', 'betsapi_id', 'betradar_id', 'bet365_id', 'bwin_id', 'magnig_id', 'magken_id', 'lognig_id', 'logcol_id']) diff --git a/app/Filament/Resources/Events/Tables/Tools/LoadBettypeSettings.php b/app/Filament/Resources/Events/Tables/Tools/LoadBettypeSettings.php index ff854dd4..559f7891 100644 --- a/app/Filament/Resources/Events/Tables/Tools/LoadBettypeSettings.php +++ b/app/Filament/Resources/Events/Tables/Tools/LoadBettypeSettings.php @@ -2,6 +2,7 @@ namespace App\Filament\Resources\Events\Tables\Tools; +use App\Filament\Resources\Events\Tables\EventsTable; use App\Models\BettypeUser; class LoadBettypeSettings @@ -18,6 +19,6 @@ class LoadBettypeSettings $arr[] = $value->multiline_setting->table; } - return $arr; + EventsTable::$bettype_settings = $arr; } } diff --git a/app/Filament/Resources/Events/Tables/Tools/LoadMultiline.php b/app/Filament/Resources/Events/Tables/Tools/LoadMultiline.php new file mode 100644 index 00000000..6dcb4b36 --- /dev/null +++ b/app/Filament/Resources/Events/Tables/Tools/LoadMultiline.php @@ -0,0 +1,61 @@ +sport_id == 1) { + // $cb = ComparingBookmaker::where('sport_id', 1)->where('client_bookmaker_id', EventsTable::$user->bookmaker_id)->orderBy('sorting')->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')->get()->toArray(); + // } else { + // $cb = ComparingBookmaker::where('sport_id', '!=', 1)->where('client_bookmaker_id', EventsTable::$user->bookmaker_id)->orderBy('sorting')->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')->get()->toArray(); + // } + + $cb = ComparingBookmaker::where('sport_id', EventsTable::$user->sport_id)->where('client_bookmaker_id', EventsTable::$user->bookmaker_id)->orderBy('sorting')->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')->get()->toArray(); + + $bookmakers = []; + $filter = []; + foreach ($cb as $value) { + $bookmakers[] = $value['bookmaker_id']; + $filter[$value['bookmaker_id']] = [ + 'time_lastcheck' => $value['time_lastcheck'], + 'margin' => $value['margin_threshold'], + ]; + } + + $res = MultilineSetting::where('sport_id', EventsTable::$user->sport_id)->get(); + + foreach ($res as $value) { + EventsTable::$filter[$value->table] = $filter; + if (EventsTable::$user->is_multiline_direct) { + EventsTable::$slots[$value->table] = $bookmakers; + array_unshift(EventsTable::$slots[$value->table], EventsTable::$user->bookmaker_id); + } + + } + + if (! EventsTable::$user->is_multiline_direct) { + $res = MultilineClient::with('multiline_setting') + ->select('bookmaker_id', 'multiline_setting_id') + ->orderBy('sort') + ->get(); + + foreach ($res as $value) { + $table = $value->multiline_setting->table; + + if (! isset(EventsTable::$slots[$table])) { + EventsTable::$slots[$table][] = (int) EventsTable::$user->bookmaker_id; + } + EventsTable::$slots[$table][] = (int) $value->bookmaker_id; + } + } + } +} diff --git a/app/Filament/Resources/Events/Tables/Tools/LoadMultilineBookmaker.php b/app/Filament/Resources/Events/Tables/Tools/LoadMultilineBookmaker.php deleted file mode 100644 index 15923a44..00000000 --- a/app/Filament/Resources/Events/Tables/Tools/LoadMultilineBookmaker.php +++ /dev/null @@ -1,66 +0,0 @@ -sport_id == 1) { - // $cb = ComparingBookmaker::where('sport_id', 1)->where('client_bookmaker_id', self::$user->bookmaker_id)->orderBy('sorting')->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')->get()->toArray(); - // } else { - // $cb = ComparingBookmaker::where('sport_id', '!=', 1)->where('client_bookmaker_id', self::$user->bookmaker_id)->orderBy('sorting')->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')->get()->toArray(); - // } - - $cb = ComparingBookmaker::where('sport_id', self::$user->sport_id)->where('client_bookmaker_id', self::$user->bookmaker_id)->orderBy('sorting')->select('bookmaker_id', 'time_lastcheck', 'margin_threshold', 'is_active')->get()->toArray(); - - $bookmakers = []; - $filter = []; - foreach ($cb as $value) { - $bookmakers[] = $value['bookmaker_id']; - $filter[$value['bookmaker_id']] = [ - 'time_lastcheck' => $value['time_lastcheck'], - 'margin' => $value['margin_threshold'], - ]; - } - - $res = MultilineSetting::where('sport_id', self::$user->sport_id)->get(); - - foreach ($res as $value) { - $arr[$value->table]['filter'] = $filter; - $arr[$value->table]['bookmaker'] = $bookmakers; - if (auth()->user()->is_multiline_direct) { - $arr[$value->table]['slots'] = $bookmakers; - } - } - - if (! auth()->user()->is_multiline_direct) { - $res = MultilineClient::with('multiline_setting') - ->select('bookmaker_id', 'multiline_setting_id') - ->orderBy('sort') - ->get(); - - foreach ($res as $value) { - $table = $value->multiline_setting->table; - $arr[$table]['slots'][] = (int) self::$user->bookmaker_id; - } - foreach ($res as $value) { - $table = $value->multiline_setting->table; - $arr[$table]['slots'][] = (int) $value->bookmaker_id; - } - } - - return $arr; - } -} diff --git a/app/Filament/Tables/Columns/Column3way.php b/app/Filament/Tables/Columns/Column3way.php deleted file mode 100644 index 241397f0..00000000 --- a/app/Filament/Tables/Columns/Column3way.php +++ /dev/null @@ -1,78 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_3ways); - - $this->act = $record->odds_3ways->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['h3w'] = $record->odds_3ways->max('h3w'); - - $this->max['d3w'] = $record->odds_3ways->max('d3w'); - - $this->max['a3w'] = $record->odds_3ways->max('a3w'); - - $this->min['h3w'] = $record->odds_3ways->min('h3w'); - - $this->min['d3w'] = $record->odds_3ways->min('d3w'); - - $this->min['a3w'] = $record->odds_3ways->min('a3w'); - - $record->odds_3ways = FilterOdds::filter($record->odds_3ways, $this->bookmakers); - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/Column3wayHt.php b/app/Filament/Tables/Columns/Column3wayHt.php deleted file mode 100644 index aab6f1c5..00000000 --- a/app/Filament/Tables/Columns/Column3wayHt.php +++ /dev/null @@ -1,78 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_3ways_ht); - - $this->act = $record->odds_3ways_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['h3w'] = $record->odds_3ways_ht->max('h3w'); - - $this->max['d3w'] = $record->odds_3ways_ht->max('d3w'); - - $this->max['a3w'] = $record->odds_3ways_ht->max('a3w'); - - $this->min['h3w'] = $record->odds_3ways_ht->min('h3w'); - - $this->min['d3w'] = $record->odds_3ways_ht->min('d3w'); - - $this->min['a3w'] = $record->odds_3ways_ht->min('a3w'); - - $record->odds_3ways_ht = FilterOdds::filter($record->odds_3ways_ht, $this->bookmakers); - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnDc.php b/app/Filament/Tables/Columns/ColumnDc.php deleted file mode 100644 index 1e272b8a..00000000 --- a/app/Filament/Tables/Columns/ColumnDc.php +++ /dev/null @@ -1,78 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_dc); - - $this->act = $record->odds_dc->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['dc1x'] = $record->odds_dc->max('dc1x'); - - $this->max['dc12'] = $record->odds_dc->max('dc12'); - - $this->max['dcx2'] = $record->odds_dc->max('dcx2'); - - $this->min['dc1x'] = $record->odds_dc->min('dc1x'); - - $this->min['dc12'] = $record->odds_dc->min('dc12'); - - $this->min['dcx2'] = $record->odds_dc->min('dcx2'); - - $record->odds_dc = FilterOdds::filter($record->odds_dc, $this->bookmakers); - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnDnb.php b/app/Filament/Tables/Columns/ColumnDnb.php deleted file mode 100644 index ed25791f..00000000 --- a/app/Filament/Tables/Columns/ColumnDnb.php +++ /dev/null @@ -1,75 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_dnb); - - $this->act = $record->odds_dnb->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['dnb1'] = $record->odds_dnb->max('dnb1'); - - $this->max['dnb2'] = $record->odds_dnb->max('dnb2'); - - $this->min['dnb1'] = $record->odds_dnb->min('dnb1'); - - $this->min['dnb2'] = $record->odds_dnb->min('dnb2'); - - $record->odds_dnb = FilterOdds::filter($record->odds_dnb, $this->bookmakers); - - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnGgng.php b/app/Filament/Tables/Columns/ColumnGgng.php deleted file mode 100644 index 819e292e..00000000 --- a/app/Filament/Tables/Columns/ColumnGgng.php +++ /dev/null @@ -1,74 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_ggng); - - $this->act = $record->odds_ggng->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['gg'] = $record->odds_ggng->max('gg'); - - $this->max['ng'] = $record->odds_ggng->max('ng'); - - $this->min['gg'] = $record->odds_ggng->min('gg'); - - $this->min['ng'] = $record->odds_ggng->min('ng'); - - $record->odds_ggng = FilterOdds::filter($record->odds_ggng, $this->bookmakers); - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnMl.php b/app/Filament/Tables/Columns/ColumnMl.php deleted file mode 100644 index 6aab63e1..00000000 --- a/app/Filament/Tables/Columns/ColumnMl.php +++ /dev/null @@ -1,74 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_2ways); - - $this->act = $record->odds_2ways->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['h2w'] = $record->odds_2ways->max('h2w'); - - $this->max['a2w'] = $record->odds_2ways->max('a2w'); - - $this->min['h2w'] = $record->odds_2ways->min('h2w'); - - $this->min['a2w'] = $record->odds_2ways->min('a2w'); - - $record->odds_2ways = FilterOdds::filter($record->odds_2ways, $this->bookmakers); - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnMlS1.php b/app/Filament/Tables/Columns/ColumnMlS1.php deleted file mode 100644 index 96c680f1..00000000 --- a/app/Filament/Tables/Columns/ColumnMlS1.php +++ /dev/null @@ -1,75 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_2ways_s1); - - $this->act = $record->odds_2ways->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['h2w'] = $record->odds_2ways->max('h2w'); - - $this->max['a2w'] = $record->odds_2ways->max('a2w'); - - $this->min['h2w'] = $record->odds_2ways->min('h2w'); - - $this->min['a2w'] = $record->odds_2ways->min('a2w'); - - $record->odds_2ways_s1 = FilterOdds::filter($record->odds_2ways_s1, $this->bookmakers); - - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnOdds.php b/app/Filament/Tables/Columns/ColumnOdds.php new file mode 100644 index 00000000..b1de4d88 --- /dev/null +++ b/app/Filament/Tables/Columns/ColumnOdds.php @@ -0,0 +1,290 @@ +setMinMax($record); + + $this->setSlots(); + + $this->getData($record); + + if (! $this->data) { + $this->has_data = 0; + + return; + } + + $this->has_data = count($this->data); + + $order = EventsTable::$slots ?? []; + $this->data->sortBy(function ($model) use ($order) { + return array_search($model->bookmaker_id, $order); + }); + + return $this->data; + } + + public function bettype(string $bettype): static + { + $this->bettype = $bettype; + + return $this; + } + + public function getBettype() + { + return $this->bettype; + } + + public function getColumns() + { + return $this->columns; + } + + public function setSlots(): void + { + $this->slots = EventsTable::$slots[$this->bettype]; + } + + public function getSlots(): ?array + { + return $this->slots; + } + + public function hasData() + { + return $this->has_data; + } + + public function getClient() + { + return $this->client; + } + + public function getMax() + { + return $this->max; + } + + public function getMin() + { + return $this->min; + } + + public function getData($record) + { + switch ($this->bettype) { + case 'odds_2ways': + $this->data = $record->odds_2ways; + $this->client = $record->odds_2ways->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_2ways_s1': + $this->data = $record->odds_2ways_s1; + $this->client = $record->odds_2ways_s1->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_3ways': + $this->data = $record->odds_3ways; + $this->client = $record->odds_3ways->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_3ways_ht': + $this->data = $record->odds_3ways_ht; + $this->client = $record->odds_3ways_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_dc': + $this->data = $record->odds_dc; + $this->client = $record->odds_dc->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_dnb': + $this->data = $record->odds_dnb; + $this->client = $record->odds_dnb->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_ggng': + $this->data = $record->odds_ggng; + $this->client = $record->odds_ggng->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_points': + $this->data = $record->odds_points; + $this->client = $record->odds_points->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_points_ht': + $this->data = $record->odds_points_ht; + $this->client = $record->odds_points_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_points_q1': + $this->data = $record->odds_points_q1; + $this->client = $record->odds_points_q1->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_totals': + $this->data = $record->odds_totals; + $this->client = $record->odds_totals->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_totals_ht': + $this->data = $record->odds_totals_ht; + $this->client = $record->odds_totals_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_totals_q1': + $this->data = $record->odds_totals_q1; + $this->client = $record->odds_totals_q1->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + case 'odds_tq': + $this->data = $record->odds_tq; + $this->client = $record->odds_tq->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); + break; + + } + } + + public function getOddsLabels() + { + switch ($this->bettype) { + case 'odds_tq': + case 'odds_2ways': + case 'odds_2ways_s1': + case 'odds_dnb': + $this->columns = 2; + $this->odds_labels = ['1', '2']; + break; + + case 'odds_3ways': + case 'odds_3ways_ht': + $this->columns = 3; + $this->odds_labels = ['1', 'X', '2']; + break; + + case 'odds_dc': + $this->columns = 3; + $this->odds_labels = ['1X', '12', 'X2']; + break; + + case 'odds_ggng': + $this->columns = 2; + $this->odds_labels = ['GG', 'NG']; + break; + + case 'odds_points': + case 'odds_points_ht': + case 'odds_points_q1': + $this->columns = 3; + $this->odds_labels = ['H', 'A', 'HC']; + break; + + case 'odds_totals': + case 'odds_totals_ht': + case 'odds_totals_q1': + $this->columns = 3; + $this->odds_labels = ['O', 'U', 'T']; + break; + } + + return $this->odds_labels; + } + + public function setMinMax($record) + { + switch ($this->bettype) { + case 'odds_2ways': + case 'odds_2ways_s1': + $this->max['h2w'] = $record->odds_2ways->max('h2w'); + $this->max['a2w'] = $record->odds_2ways->max('a2w'); + $this->min['h2w'] = $record->odds_2ways->min('h2w'); + $this->min['h2w'] = $record->odds_2ways->min('h2w'); + break; + + case 'odds_3ways': + case 'odds_3ways_ht': + $this->max['h3w'] = $record->odds_3ways_ht->max('h3w'); + $this->max['d3w'] = $record->odds_3ways_ht->max('d3w'); + $this->max['a3w'] = $record->odds_3ways_ht->max('a3w'); + $this->min['h3w'] = $record->odds_3ways_ht->min('h3w'); + $this->min['d3w'] = $record->odds_3ways_ht->min('d3w'); + $this->min['a3w'] = $record->odds_3ways_ht->min('a3w'); + break; + + case 'odds_dc': + $this->max['dc1x'] = $record->odds_dc->max('dc1x'); + $this->max['dc12'] = $record->odds_dc->max('dc12'); + $this->max['dcx2'] = $record->odds_dc->max('dcx2'); + $this->min['dc1x'] = $record->odds_dc->min('dc1x'); + $this->min['dc12'] = $record->odds_dc->min('dc12'); + $this->min['dcx2'] = $record->odds_dc->min('dcx2'); + break; + case 'odds_dnb': + $this->max['dnb1'] = $record->odds_dnb->max('dnb1'); + $this->max['dnb2'] = $record->odds_dnb->max('dnb2'); + $this->min['dnb1'] = $record->odds_dnb->min('dnb1'); + $this->min['dnb2'] = $record->odds_dnb->min('dnb2'); + break; + + case 'odds_ggng': + $this->max['gg'] = $record->odds_ggng->max('gg'); + $this->max['ng'] = $record->odds_ggng->max('ng'); + $this->min['gg'] = $record->odds_ggng->min('gg'); + $this->min['ng'] = $record->odds_ggng->min('ng'); + break; + case 'odds_points': + case 'odds_points_ht': + case 'odds_points_q1': + $this->max['home'] = $record->odds_points->max('home'); + $this->max['away'] = $record->odds_points->max('away'); + $this->min['home'] = $record->odds_points->min('home'); + $this->min['away'] = $record->odds_points->min('away'); + break; + + case 'odds_totals': + case 'odds_totals_ht': + case 'odds_totals_q1': + $this->max['over'] = $record->odds_totals->max('over'); + $this->max['under'] = $record->odds_totals->max('under'); + $this->min['over'] = $record->odds_totals->min('over'); + $this->min['under'] = $record->odds_totals->min('under'); + break; + + case 'odds_tq': + $this->max['htq'] = $record->odds_tq->max('htq'); + $this->max['atq'] = $record->odds_tq->max('atq'); + $this->min['htq'] = $record->odds_tq->min('htq'); + $this->min['atq'] = $record->odds_tq->min('atq'); + break; + + } + + } +} diff --git a/app/Filament/Tables/Columns/ColumnPoint.php b/app/Filament/Tables/Columns/ColumnPoint.php deleted file mode 100644 index 92c850b7..00000000 --- a/app/Filament/Tables/Columns/ColumnPoint.php +++ /dev/null @@ -1,75 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_points); - - $this->act = $record->odds_points->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['home'] = $record->odds_points->max('home'); - - $this->max['away'] = $record->odds_points->max('away'); - - $this->min['home'] = $record->odds_points->min('home'); - - $this->min['away'] = $record->odds_points->min('away'); - - $record->odds_points = FilterOdds::filter($record->odds_points, $this->bookmakers); - - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnPointQ1.php b/app/Filament/Tables/Columns/ColumnPointQ1.php deleted file mode 100644 index b194cada..00000000 --- a/app/Filament/Tables/Columns/ColumnPointQ1.php +++ /dev/null @@ -1,75 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_points_q1); - - $this->act = $record->odds_points_q1->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['home'] = $record->odds_points_q1->max('home'); - - $this->max['away'] = $record->odds_points_q1->max('away'); - - $this->min['home'] = $record->odds_points_q1->min('home'); - - $this->min['away'] = $record->odds_points_q1->min('away'); - - $record->odds_points_q1 = FilterOdds::filter($record->odds_points_q1, $this->bookmakers); - - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnTotal.php b/app/Filament/Tables/Columns/ColumnTotal.php deleted file mode 100644 index e8a0eb75..00000000 --- a/app/Filament/Tables/Columns/ColumnTotal.php +++ /dev/null @@ -1,75 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_totals); - - $this->act = $record->odds_totals->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['over'] = $record->odds_totals->max('over'); - - $this->max['under'] = $record->odds_totals->max('under'); - - $this->min['over'] = $record->odds_totals->min('over'); - - $this->min['under'] = $record->odds_totals->min('under'); - - $record->odds_totals = FilterOdds::filter($record->odds_totals, $this->bookmakers); - - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnTotalHt.php b/app/Filament/Tables/Columns/ColumnTotalHt.php deleted file mode 100644 index ec3cf7d3..00000000 --- a/app/Filament/Tables/Columns/ColumnTotalHt.php +++ /dev/null @@ -1,75 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_totals_ht); - - $this->act = $record->odds_totals_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['over'] = $record->odds_totals_ht->max('over'); - - $this->max['under'] = $record->odds_totals_ht->max('under'); - - $this->min['over'] = $record->odds_totals_ht->min('over'); - - $this->min['under'] = $record->odds_totals_ht->min('under'); - - $record->odds_totals_ht = FilterOdds::filter($record->odds_totals_ht, $this->bookmakers); - - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnTotalQ1.php b/app/Filament/Tables/Columns/ColumnTotalQ1.php deleted file mode 100644 index c7da8211..00000000 --- a/app/Filament/Tables/Columns/ColumnTotalQ1.php +++ /dev/null @@ -1,75 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_totals_q1); - - $this->act = $record->odds_totals_q1->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['over'] = $record->odds_totals_q1->max('over'); - - $this->max['under'] = $record->odds_totals_q1->max('under'); - - $this->min['over'] = $record->odds_totals_q1->min('over'); - - $this->min['under'] = $record->odds_totals_q1->min('under'); - - $record->odds_totals_q1 = FilterOdds::filter($record->odds_totals_q1, $this->bookmakers); - - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/ColumnTq.php b/app/Filament/Tables/Columns/ColumnTq.php deleted file mode 100644 index 672c9d53..00000000 --- a/app/Filament/Tables/Columns/ColumnTq.php +++ /dev/null @@ -1,75 +0,0 @@ -bookmakers = $bookmakers; - - return $this; - } - - public function getBookmaker(): ?array - { - return $this->bookmakers['bookmaker'] ?? []; - } - - public function getSlots(): ?array - { - return $this->bookmakers['slots'] ?? []; - } - - public function loadData($record) - { - $this->has_data = count($record->odds_tq); - - $this->act = $record->odds_tq->where('bookmaker_id', auth()->user()->bookmaker_id)->first(); - - $this->max['htq'] = $record->odds_tq->max('htq'); - - $this->max['atq'] = $record->odds_tq->max('atq'); - - $this->min['htq'] = $record->odds_tq->min('htq'); - - $this->min['atq'] = $record->odds_tq->min('atq'); - - $record->odds_tq = FilterOdds::filter($record->odds_tq, $this->bookmakers); - - } - - public function getAct() - { - return $this->act; - } - - public function getMax() - { - return $this->max; - } - - public function getMin() - { - return $this->min; - } - - public function hasData() - { - return $this->has_data; - } -} diff --git a/app/Filament/Tables/Columns/FilterOdds.php b/app/Filament/Tables/Columns/FilterOdds.php index 6ff99a38..f106b975 100644 --- a/app/Filament/Tables/Columns/FilterOdds.php +++ b/app/Filament/Tables/Columns/FilterOdds.php @@ -2,12 +2,13 @@ namespace App\Filament\Tables\Columns; +namespace App\Filament\Tables\Columns; + use Carbon\Carbon; -use Illuminate\Database\Eloquent\Collection; class FilterOdds { - public static function filter($data, $bookmakers): Collection + public static function filter(&$bookmakers) { if (auth()->user()->is_multiline_direct) { /** @@ -15,43 +16,37 @@ class FilterOdds */ $order = $bookmakers['bookmaker'] ?? []; - $data->sortBy(function ($model) use ($order) { + ColumnOdds::$data->sortBy(function ($model) use ($order) { return array_search($model->bookmaker_id, $order); }); - - /** - * FILTER - */ - // if (! auth()->user()->no_filter) { - - // $filter = $bookmakers['filter'] ?? []; - - // if ($filter) { - // $data = $data->filter(function ($model) use ($filter) { - - // if ($model->bookmaker_id == auth()->user()->bookmaker_id) { - // return true; - // } - - // $filter = $filter[$model->bookmaker_id] ?? 0; - - // $checked_at = Carbon::createFromDate($model->checked_at)->timestamp; - - // if (! isset($filter['margin'])) { - // Bookmakers::updateOrCreate(['id' => (int) $model->bookmaker_id], ['need_check' => 1]); - // } - - // if ($model->margin <= $filter['margin'] && $checked_at > time() - $filter['time_lastcheck']) { - // return true; - // } - - // return false; - // }); - // } - // } } - return $data; + /** + * SET SLOT + */ + // $filter = $bookmakers['filter'] ?? []; + // if ($filter) { + // $data = $data->filter(function ($model) use ($filter) { + + // if ($model->bookmaker_id == auth()->user()->bookmaker_id) { + // return true; + // } + + // $filter = $filter[$model->bookmaker_id] ?? 0; + + // $checked_at = Carbon::createFromDate($model->checked_at)->timestamp; + + // if (! isset($filter['margin'])) { + // Bookmakers::updateOrCreate(['id' => (int) $model->bookmaker_id], ['need_check' => 1]); + // } + + // if ($model->margin <= $filter['margin'] && $checked_at > time() - $filter['time_lastcheck']) { + // return true; + // } + + // return false; + // }); + // } } } diff --git a/app/Filament/Tables/Columns/TooltipOdds.php b/app/Filament/Tables/Columns/TooltipOdds.php index 23668cc1..e5cff629 100644 --- a/app/Filament/Tables/Columns/TooltipOdds.php +++ b/app/Filament/Tables/Columns/TooltipOdds.php @@ -164,7 +164,9 @@ class TooltipOdds extends Column public function getOdd($odd, $name) { - if ($odd == $this->max[$name]) { + if (in_array($name, ['handicap', 'total'])) { + $str = '
'; + } elseif ($odd == $this->max[$name]) { $str = '
'; } elseif ($odd == $this->min[$name]) { $str = '
'; diff --git a/resources/views/filament/tables/columns/column-dc.blade.php b/resources/views/filament/tables/columns/column-dc.blade.php deleted file mode 100644 index fa36f7b5..00000000 --- a/resources/views/filament/tables/columns/column-dc.blade.php +++ /dev/null @@ -1,50 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['1X', '12', 'X2']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_dc as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->dc1x, - 'dec' => 2, - 'hig' => isset($act['dc1x']) && $item->dc1x >= $act['dc1x'] ? 1 : 0, - 'has' => isset($act['dc1x']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->dc12, - 'dec' => 2, - 'hig' => isset($act['dc12']) && $item->dc12 >= $act['dc12'] ? 1 : 0, - 'has' => isset($act['dc12']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->dcx2, - 'dec' => 2, - 'hig' => isset($act['dcx2']) && $item->dcx2 >= $act['dcx2'] ? 1 : 0, - 'has' => isset($act['dcx2']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column-dnb.blade.php b/resources/views/filament/tables/columns/column-dnb.blade.php deleted file mode 100644 index 989f6cc6..00000000 --- a/resources/views/filament/tables/columns/column-dnb.blade.php +++ /dev/null @@ -1,43 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['DNB1', 'DNB2']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_dnb as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->dnb1, - 'dec' => 2, - 'hig' => isset($act['dnb1']) && $item->dnb1 >= $act['dnb1'] ? 1 : 0, - 'has' => isset($act['dnb1']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->dnb2, - 'dec' => 2, - 'hig' => isset($act['dnb2']) && $item->dnb2 >= $act['dnb2'] ? 1 : 0, - 'has' => isset($act['dnb2']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column-ggng.blade.php b/resources/views/filament/tables/columns/column-ggng.blade.php deleted file mode 100644 index 5b299e9d..00000000 --- a/resources/views/filament/tables/columns/column-ggng.blade.php +++ /dev/null @@ -1,43 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['GG', 'NG']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_ggng as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->gg, - 'dec' => 2, - 'hig' => isset($act['gg']) && $item->gg >= $act['gg'] ? 1 : 0, - 'has' => isset($act['gg']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->ng, - 'dec' => 2, - 'hig' => isset($act['ng']) && $item->ng >= $act['ng'] ? 1 : 0, - 'has' => isset($act['ng']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column-ml-s1.blade.php b/resources/views/filament/tables/columns/column-ml-s1.blade.php deleted file mode 100644 index 81905d2e..00000000 --- a/resources/views/filament/tables/columns/column-ml-s1.blade.php +++ /dev/null @@ -1,43 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['1', '2']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_2ways_s1 as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->h2w, - 'dec' => 2, - 'hig' => isset($act['h2w']) && $item->h2w >= $act[''] ? 1 : 0, - 'has' => isset($act['h2w']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->a2w, - 'dec' => 2, - 'hig' => isset($act['a2w']) && $item->a2w >= $act['a2w'] ? 1 : 0, - 'has' => isset($act['a2w']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column-ml.blade.php b/resources/views/filament/tables/columns/column-ml.blade.php deleted file mode 100644 index c87091b8..00000000 --- a/resources/views/filament/tables/columns/column-ml.blade.php +++ /dev/null @@ -1,43 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['1', '2']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_2ways as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->h2w, - 'dec' => 2, - 'hig' => isset($act['h2w']) && $item->h2w >= $act[''] ? 1 : 0, - 'has' => isset($act['h2w']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->a2w, - 'dec' => 2, - 'hig' => isset($act['a2w']) && $item->a2w >= $act['a2w'] ? 1 : 0, - 'has' => isset($act['a2w']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column-odds.blade.php b/resources/views/filament/tables/columns/column-odds.blade.php new file mode 100644 index 00000000..77d7138d --- /dev/null +++ b/resources/views/filament/tables/columns/column-odds.blade.php @@ -0,0 +1,137 @@ +@php + $data = $loadData($record); +@endphp + + +@if ($hasData()) + + @php + $client = $getClient(); + $label = $getOddsLabels(); + @endphp + + @if ($getColumns() == 2) +
+ @else +
+ @endif + + @include('filament.tables.columns.multiline.label', ['labels' => $label]) + + @foreach ($data as $item) + @if (in_array($item->bookmaker_id, $getSlots())) + @include('filament.tables.columns.multiline.bkm', [ + 'bookmaker_id' => $item->bookmaker_id, + 'icon' => $item->bookmaker->icon ?? '', + ]) + + @switch ($getBettype()) + @case ('odds_tq') + + @case ('odds_2ways') + + @case ('odds_2ways_s1') + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->h2w, + 'client' => $client?->h2w, + ]) + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->a2w, + 'client' => $client?->a2w, + ]) + @break; + @case ('odds_3ways') + + @case ('odds_3ways_ht') + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->h3w, + 'client' => $client?->h3w, + ]) + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->d3w, + 'client' => $client?->d3w, + ]) + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->a3w, + 'client' => $client?->a3w, + ]) + @break; + @case ('odds_dc') + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->dc1x, + 'client' => $client?->dc1x, + ]) + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->dc12, + 'client' => $client?->dc12, + ]) + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->dcx2, + 'client' => $client?->dcx2, + ]) + @break; + @case ('odds_dnb') + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->dnb1, + 'client' => $client?->dnb1, + ]) + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->dnb2, + 'client' => $client?->dnb2, + ]) + @break; + @case ('odds_ggng') + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->gg, + 'client' => $client?->gg, + ]) + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->ng, + 'client' => $client?->ng, + ]) + @break; + @case ('odds_points') + + @case ('odds_points_ht') + + @case ('odds_points_q1') + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->home, + 'client' => $client?->home, + ]) + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->away, + 'client' => $client?->away, + ]) + @include('filament.tables.columns.multiline.spread', [ + 'odd' => $item->handicap, + ]) + @break; + @case ('odds_totals') + + @case ('odds_totals_ht') + + @case ('odds_totals_q1') + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->over, + 'client' => $client?->over, + ]) + @include('filament.tables.columns.multiline.odd', [ + 'odd' => $item->under, + 'client' => $client?->under, + ]) + @include('filament.tables.columns.multiline.spread', [ + 'odd' => $item->total, + ]) + @break; + @endswitch + + + @include('filament.tables.columns.multiline.spread', [ + 'odd' => $item->margin, + ]) + @endif + @endforeach +
+@endif diff --git a/resources/views/filament/tables/columns/column-point-q1.blade.php b/resources/views/filament/tables/columns/column-point-q1.blade.php deleted file mode 100644 index b39ca721..00000000 --- a/resources/views/filament/tables/columns/column-point-q1.blade.php +++ /dev/null @@ -1,49 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['O', 'U', 'T']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_points_q1 as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->home, - 'dec' => 2, - 'hig' => isset($act['home']) && $item->home >= $act['home'] ? 1 : 0, - 'has' => isset($act['home']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->away, - 'dec' => 2, - 'hig' => isset($act['away']) && $item->away >= $act['away'] ? 1 : 0, - 'has' => isset($act['away']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->handicap, - 'dec' => 1, - 'has' => false, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column-point.blade.php b/resources/views/filament/tables/columns/column-point.blade.php deleted file mode 100644 index 3d76438d..00000000 --- a/resources/views/filament/tables/columns/column-point.blade.php +++ /dev/null @@ -1,49 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['O', 'U', 'T']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_points as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->home, - 'dec' => 2, - 'hig' => isset($act['home']) && $item->home >= $act['home'] ? 1 : 0, - 'has' => isset($act['home']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->away, - 'dec' => 2, - 'hig' => isset($act['away']) && $item->away >= $act['away'] ? 1 : 0, - 'has' => isset($act['away']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->handicap, - 'dec' => 1, - 'has' => false, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column-total-ht.blade.php b/resources/views/filament/tables/columns/column-total-ht.blade.php deleted file mode 100644 index d555ac9c..00000000 --- a/resources/views/filament/tables/columns/column-total-ht.blade.php +++ /dev/null @@ -1,49 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['O', 'U', 'T']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_totals_ht as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->over, - 'dec' => 2, - 'hig' => isset($act['over']) && $item->over >= $act['over'] ? 1 : 0, - 'has' => isset($act['over']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->under, - 'dec' => 2, - 'hig' => isset($act['under']) && $item->under >= $act['under'] ? 1 : 0, - 'has' => isset($act['under']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->total, - 'dec' => 1, - 'has' => false, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column-total-q1.blade.php b/resources/views/filament/tables/columns/column-total-q1.blade.php deleted file mode 100644 index c343e13a..00000000 --- a/resources/views/filament/tables/columns/column-total-q1.blade.php +++ /dev/null @@ -1,49 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['O', 'U', 'T']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_totals_q1 as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->over, - 'dec' => 2, - 'hig' => isset($act['over']) && $item->over >= $act['over'] ? 1 : 0, - 'has' => isset($act['over']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->under, - 'dec' => 2, - 'hig' => isset($act['under']) && $item->under >= $act['under'] ? 1 : 0, - 'has' => isset($act['under']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->total, - 'dec' => 1, - 'has' => false, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column-total.blade.php b/resources/views/filament/tables/columns/column-total.blade.php deleted file mode 100644 index 74551c78..00000000 --- a/resources/views/filament/tables/columns/column-total.blade.php +++ /dev/null @@ -1,49 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['O', 'U', 'T']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_totals as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->over, - 'dec' => 2, - 'hig' => isset($act['over']) && $item->over >= $act['over'] ? 1 : 0, - 'has' => isset($act['over']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->under, - 'dec' => 2, - 'hig' => isset($act['under']) && $item->under >= $act['under'] ? 1 : 0, - 'has' => isset($act['under']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->total, - 'dec' => 1, - 'has' => false, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column-tq.blade.php b/resources/views/filament/tables/columns/column-tq.blade.php deleted file mode 100644 index bfd41b42..00000000 --- a/resources/views/filament/tables/columns/column-tq.blade.php +++ /dev/null @@ -1,42 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['H', 'A']]) - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_tq as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->htq, - 'dec' => 2, - 'hig' => isset($act['htq']) && $item->htq >= $act['htq'] ? 1 : 0, - 'has' => isset($act['htq']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->atq, - 'dec' => 2, - 'hig' => isset($act['atq']) && $item->atq >= $act['atq'] ? 1 : 0, - 'has' => isset($act['atq']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column_3way.blade.php b/resources/views/filament/tables/columns/column_3way.blade.php deleted file mode 100644 index 73299867..00000000 --- a/resources/views/filament/tables/columns/column_3way.blade.php +++ /dev/null @@ -1,55 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); - $max = $getMax(); - $min = $getMin(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', [ - 'labels' => ['1', 'X', '2'], - 'twice' => false, - ]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_3ways as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->h3w, - 'dec' => 2, - 'hig' => isset($act['h3w']) && $item->h3w >= $act['h3w'] ? 1 : 0, - 'has' => isset($act['h3w']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->d3w, - 'dec' => 2, - 'hig' => isset($act['d3w']) && $item->d3w >= $act['d3w'] ? 1 : 0, - 'has' => isset($act['d3w']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->a3w, - 'dec' => 2, - 'hig' => isset($act['a3w']) && $item->a3w >= $act['a3w'] ? 1 : 0, - 'has' => isset($act['a3w']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/column_3way_ht.blade.php b/resources/views/filament/tables/columns/column_3way_ht.blade.php deleted file mode 100644 index 11788929..00000000 --- a/resources/views/filament/tables/columns/column_3way_ht.blade.php +++ /dev/null @@ -1,50 +0,0 @@ -@php - $loadData($record); - $act = $getAct(); -@endphp - -@if ($hasData()) - -
- - @include('filament.tables.columns.multiline.label', ['labels' => ['1', 'X', '2']]) - - @foreach ($getBookmaker() as $bookmaker_id) - @foreach ($record->odds_3ways_ht as $item) - @if ($item->bookmaker_id == $bookmaker_id && in_array($item->bookmaker_id, $getSlots())) - @include('filament.tables.columns.multiline.bkm', [ - 'bookmaker_id' => $item->bookmaker_id, - 'icon' => $item->bookmaker->icon ?? '', - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->h3w, - 'dec' => 2, - 'hig' => isset($act['h3w']) && $item->h3w >= $act['h3w'] ? 1 : 0, - 'has' => isset($act['h3w']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->d3w, - 'dec' => 2, - 'hig' => isset($act['d3w']) && $item->d3w >= $act['d3w'] ? 1 : 0, - 'has' => isset($act['d3w']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->a3w, - 'dec' => 2, - 'hig' => isset($act['a3w']) && $item->a3w >= $act['a3w'] ? 1 : 0, - 'has' => isset($act['a3w']) && $item->bookmaker_id != auth()->user()->bookmaker_id, - ]) - - @include('filament.tables.columns.multiline.odds', [ - 'odd' => $item->margin, - 'dec' => 1, - 'has' => false, - ]) - @endif - @endforeach - @endforeach -
-@endif diff --git a/resources/views/filament/tables/columns/multiline/odd.blade.php b/resources/views/filament/tables/columns/multiline/odd.blade.php new file mode 100644 index 00000000..09759d15 --- /dev/null +++ b/resources/views/filament/tables/columns/multiline/odd.blade.php @@ -0,0 +1,10 @@ +@if ($client > 1 && $odd >= $client) +
+ @else +
+@endif +  +@if (isset($odd)) + {{ number_format($odd, 2) }} +@endif +
diff --git a/resources/views/filament/tables/columns/multiline/odds.blade.php b/resources/views/filament/tables/columns/multiline/odds.blade.php deleted file mode 100644 index 87c3ffc9..00000000 --- a/resources/views/filament/tables/columns/multiline/odds.blade.php +++ /dev/null @@ -1,14 +0,0 @@ -
-   - @if (isset($odd)) - {{ number_format($odd, $dec) }} - @endif -   -
diff --git a/resources/views/filament/tables/columns/multiline/spread.blade.php b/resources/views/filament/tables/columns/multiline/spread.blade.php new file mode 100644 index 00000000..12c147eb --- /dev/null +++ b/resources/views/filament/tables/columns/multiline/spread.blade.php @@ -0,0 +1,7 @@ +
+   + @if (isset($odd)) + {{ number_format($odd, 1) }} + @endif +   +