multi betts wip
This commit is contained in:
1 parent
1aa044fff1
commit
b39196c9eb
62 files changed
+1237
-208
No files matched your search
@@ -58,23 +58,48 @@ class EventResource extends Resource
|
||||
->with('country')
|
||||
->with('home')
|
||||
->with('away');
|
||||
if (in_array(1, EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_3way.bookmaker');
|
||||
|
||||
if (in_array('odds_2ways', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_2ways.bookmaker');
|
||||
}
|
||||
if (in_array(2, EventsTable::$bettype_settings)) {
|
||||
if (in_array('odds_2ways_s1', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_2ways_s1.bookmaker');
|
||||
}
|
||||
if (in_array('odds_3ways', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_3ways.bookmaker');
|
||||
}
|
||||
if (in_array('odds_3ways_ht', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_3ways_ht.bookmaker');
|
||||
}
|
||||
if (in_array('odds_dc', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_dc.bookmaker');
|
||||
}
|
||||
if (in_array(3, EventsTable::$bettype_settings)) {
|
||||
if (in_array('odds_dnb', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_dnb.bookmaker');
|
||||
}
|
||||
if (in_array(4, EventsTable::$bettype_settings)) {
|
||||
if (in_array('odds_ggng', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_ggng.bookmaker');
|
||||
}
|
||||
if (in_array(5, EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_tq.bookmaker');
|
||||
if (in_array('odds_points', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_points.bookmaker');
|
||||
}
|
||||
if (in_array(6, EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_total.bookmaker');
|
||||
if (in_array('odds_points_ht', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_points_ht.bookmaker');
|
||||
}
|
||||
if (in_array('odds_points_q1', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_points_q1.bookmaker');
|
||||
}
|
||||
if (in_array('odds_totals', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_totals.bookmaker');
|
||||
}
|
||||
if (in_array('odds_totals_ht', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_totals_ht.bookmaker');
|
||||
}
|
||||
if (in_array('odds_totals_q1', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_totals_q1.bookmaker');
|
||||
}
|
||||
if (in_array('odds_tq', EventsTable::$bettype_settings)) {
|
||||
$query->with('odds_tq.bookmaker');
|
||||
}
|
||||
|
||||
return $query;
|
||||
|
||||
@@ -6,7 +6,12 @@ use App\Filament\Tables\Columns\Column3way;
|
||||
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\ColumnTotalQ1;
|
||||
use App\Filament\Tables\Columns\ColumnTq;
|
||||
use App\Filament\Tables\Columns\MatchIds;
|
||||
use App\Models\BettypeUser;
|
||||
@@ -38,82 +43,23 @@ class EventsTable
|
||||
|
||||
public static $multiline_bookmaker = [];
|
||||
|
||||
public static $odds_3ways = [];
|
||||
|
||||
public static $odds_totals = [];
|
||||
|
||||
public static $odds_totals_q1 = [];
|
||||
|
||||
public static $odds_dc = [];
|
||||
|
||||
public static $odds_dnb = [];
|
||||
|
||||
public static $odds_ggng = [];
|
||||
|
||||
public static $odds_points = [];
|
||||
|
||||
public static $odds_points_q1 = [];
|
||||
|
||||
public static $odds_2ways = [];
|
||||
|
||||
public static $odds_2ways_s1 = [];
|
||||
|
||||
public static $odds_tq = [];
|
||||
public static $multiline_gettype = [];
|
||||
|
||||
public static function load_multiline_bookmaker()
|
||||
{
|
||||
$res = MultilineClient::where('client_id', auth()->user()->client_id)->where('sport_id', auth()->user()->sport_id)->select('bookmaker_id', 'multiline_setting_id')->orderBy('multiline_setting_id')->orderBy('sort')->get();
|
||||
$res = MultilineClient::with('multiline_setting')->where('client_id', auth()->user()->client_id)->where('sport_id', auth()->user()->sport_id)->select('bookmaker_id', 'multiline_setting_id')->orderBy('multiline_setting_id')->orderBy('sort')->get();
|
||||
|
||||
foreach ($res as $value) {
|
||||
switch ($value->multiline_setting_id) {
|
||||
case 1:
|
||||
case 13:
|
||||
self::$odds_3ways[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 2:
|
||||
self::$odds_dc[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 3:
|
||||
self::$odds_dnb[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 4:
|
||||
self::$odds_ggng[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 5:
|
||||
self::$odds_tq[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 8:
|
||||
case 14:
|
||||
self::$odds_points[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 9:
|
||||
self::$odds_points_q1[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 7:
|
||||
case 12:
|
||||
case 16:
|
||||
self::$odds_2ways[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 17:
|
||||
self::$odds_2ways_s1[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 6:
|
||||
case 10:
|
||||
case 15:
|
||||
case 18:
|
||||
self::$odds_totals[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 11:
|
||||
self::$odds_totals_q1[] = $value->bookmaker_id;
|
||||
break;
|
||||
}
|
||||
|
||||
self::$multiline_gettype[$value->multiline_setting->table][] = $value->bookmaker_id;
|
||||
}
|
||||
}
|
||||
|
||||
public static function load_bettype_settings()
|
||||
{
|
||||
self::$bettype_settings = BettypeUser::where('is_active', 1)->pluck('multiline_setting_id')->toArray();
|
||||
$res = BettypeUser::with('multiline_setting')->where('is_active', 1)->get();
|
||||
foreach ($res as $value) {
|
||||
self::$bettype_settings[] = $value->multiline_setting->table;
|
||||
}
|
||||
}
|
||||
|
||||
public static function configure(Table $table): Table
|
||||
@@ -160,42 +106,82 @@ class EventsTable
|
||||
TextColumn::make('away.name')
|
||||
->wrap()
|
||||
->searchable(),
|
||||
|
||||
Column3way::make('odds3way')->bookmakers(self::$odds_3ways)
|
||||
->visible(fn () => in_array(1, self::$bettype_settings))
|
||||
ColumnMl::make('odds_2ways')->bookmakers(self::$multiline_gettype['odds_2ways'] ?? [])
|
||||
->visible(fn () => in_array('odds_2ways', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->width(225)
|
||||
->label('1 X 2'),
|
||||
->alignCenter()
|
||||
->label('ML'),
|
||||
|
||||
ColumnDc::make('oddsdc')->bookmakers(self::$odds_dc)
|
||||
->visible(fn () => in_array(2, self::$bettype_settings))
|
||||
ColumnMlS1::make('odds_2ways_s1')->bookmakers(self::$multiline_gettype['odds_2ways'] ?? [])
|
||||
->visible(fn () => in_array('odds_2ways_s1', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(225)
|
||||
->label('ML S1'),
|
||||
|
||||
Column3way::make('odds_3ways')->bookmakers(self::$multiline_gettype['odds_3ways'] ?? [])
|
||||
->visible(fn () => in_array('odds_3ways', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->width(225)
|
||||
->label('1X2'),
|
||||
|
||||
ColumnTotal::make('odds_totals')->bookmakers(self::$multiline_gettype['odds_totals'] ?? [])
|
||||
->visible(fn () => in_array('odds_totals', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(225)
|
||||
->label('Totals'),
|
||||
|
||||
ColumnTotalQ1::make('odds_totals_q1')->bookmakers(self::$multiline_gettype['odds_totals_q1'] ?? [])
|
||||
->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(225)
|
||||
->label('Totals Q1'),
|
||||
|
||||
ColumnPoint::make('odds_points')->bookmakers(self::$multiline_gettype['odds_points'] ?? [])
|
||||
->visible(fn () => in_array('odds_points', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(225)
|
||||
->label('Points'),
|
||||
|
||||
ColumnPointQ1::make('odds_points_q1')->bookmakers(self::$multiline_gettype['odds_points_q1'] ?? [])
|
||||
->visible(fn () => in_array('odds_points_q1', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(225)
|
||||
->label('Points Q1'),
|
||||
|
||||
ColumnDc::make('odds_dc')->bookmakers(self::$multiline_gettype['odds_dc'] ?? [])
|
||||
->visible(fn () => in_array('odds_dc', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(225)
|
||||
->label('Double Chance'),
|
||||
|
||||
ColumnDnb::make('oddsdnb')->bookmakers(self::$odds_dnb)
|
||||
->visible(fn () => in_array(3, self::$bettype_settings))
|
||||
ColumnDnb::make('odds_dnb')->bookmakers(self::$multiline_gettype['odds_dnb'] ?? [])
|
||||
->visible(fn () => in_array('odds_dnb', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(190)
|
||||
->label('Draw No Bet'),
|
||||
|
||||
ColumnGgng::make('oddsggng')->bookmakers(self::$odds_ggng)
|
||||
->visible(fn () => in_array(4, self::$bettype_settings))
|
||||
ColumnGgng::make('odds_ggng')->bookmakers(self::$multiline_gettype['odds_ggng'] ?? [])
|
||||
->visible(fn () => in_array('odds_ggng', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(190)
|
||||
->label('Goal No Goal'),
|
||||
|
||||
ColumnTq::make('oddstq')->bookmakers(self::$odds_tq)
|
||||
->visible(fn () => in_array(5, self::$bettype_settings))
|
||||
ColumnTq::make('odds_tq')->bookmakers(self::$bettype_settings['odds_tq'] ?? [])
|
||||
->visible(fn () => in_array('odds_tq', self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->alignCenter()
|
||||
->width(190)
|
||||
->label('To Qualify'),
|
||||
|
||||
ColumnTotal::make('oddstotal')->bookmakers(self::$odds_totals)
|
||||
->visible(fn () => in_array(6, self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->width(225)
|
||||
->label('Totals'),
|
||||
])->searchable(['id', 'betsapi_id', 'betradar_id', 'bet365_id', 'bwin_id', 'magnig_id', 'magken_id', 'lognig_id', 'logcol_id'])
|
||||
->defaultSort('starttime', 'ASC')
|
||||
->extremePaginationLinks()
|
||||
|
||||
@@ -34,21 +34,21 @@ class Column3way extends Column
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->has_data = count($record->odds_3way) ? true : false;
|
||||
$this->has_data = count($record->odds_3ways) ? true : false;
|
||||
|
||||
$this->act = $record->odds_3way->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->act = $record->odds_3ways->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
|
||||
$this->max['h3w'] = $record->odds_3way->max('h3w');
|
||||
$this->max['h3w'] = $record->odds_3ways->max('h3w');
|
||||
|
||||
$this->max['d3w'] = $record->odds_3way->max('d3w');
|
||||
$this->max['d3w'] = $record->odds_3ways->max('d3w');
|
||||
|
||||
$this->max['a3w'] = $record->odds_3way->max('a3w');
|
||||
$this->max['a3w'] = $record->odds_3ways->max('a3w');
|
||||
|
||||
$this->min['h3w'] = $record->odds_3way->min('h3w');
|
||||
$this->min['h3w'] = $record->odds_3ways->min('h3w');
|
||||
|
||||
$this->min['d3w'] = $record->odds_3way->min('d3w');
|
||||
$this->min['d3w'] = $record->odds_3ways->min('d3w');
|
||||
|
||||
$this->min['a3w'] = $record->odds_3way->min('a3w');
|
||||
$this->min['a3w'] = $record->odds_3ways->min('a3w');
|
||||
}
|
||||
|
||||
public function getAct()
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class ColumnMl extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-ml';
|
||||
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected $max;
|
||||
|
||||
protected $min;
|
||||
|
||||
protected $act;
|
||||
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
array_unshift($bookmakers, auth()->user()->bookmaker_id);
|
||||
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->has_data = count($record->odds_2ways) ? true : false;
|
||||
|
||||
$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');
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class ColumnMlS1 extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-ml-s1';
|
||||
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected $max;
|
||||
|
||||
protected $min;
|
||||
|
||||
protected $act;
|
||||
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
array_unshift($bookmakers, auth()->user()->bookmaker_id);
|
||||
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->has_data = count($record->odds_2ways_s1) ? true : false;
|
||||
|
||||
$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');
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class ColumnPoint extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-point';
|
||||
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected $max;
|
||||
|
||||
protected $min;
|
||||
|
||||
protected $act;
|
||||
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
array_unshift($bookmakers, auth()->user()->bookmaker_id);
|
||||
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->has_data = count($record->odds_points) ? true : false;
|
||||
|
||||
$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');
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class ColumnPointQ1 extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-point-q1';
|
||||
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected $max;
|
||||
|
||||
protected $min;
|
||||
|
||||
protected $act;
|
||||
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
array_unshift($bookmakers, auth()->user()->bookmaker_id);
|
||||
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->has_data = count($record->odds_points_q1) ? true : false;
|
||||
|
||||
$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');
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -34,17 +34,17 @@ class ColumnTotal extends Column
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->has_data = count($record->odds_total) ? true : false;
|
||||
$this->has_data = count($record->odds_totals) ? true : false;
|
||||
|
||||
$this->act = $record->odds_total->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->act = $record->odds_totals->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
|
||||
$this->max['over'] = $record->odds_total->max('over');
|
||||
$this->max['over'] = $record->odds_totals->max('over');
|
||||
|
||||
$this->max['under'] = $record->odds_total->max('under');
|
||||
$this->max['under'] = $record->odds_totals->max('under');
|
||||
|
||||
$this->min['over'] = $record->odds_total->min('over');
|
||||
$this->min['over'] = $record->odds_totals->min('over');
|
||||
|
||||
$this->min['under'] = $record->odds_total->min('under');
|
||||
$this->min['under'] = $record->odds_totals->min('under');
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class ColumnTotalQ1 extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-total-q1';
|
||||
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected $max;
|
||||
|
||||
protected $min;
|
||||
|
||||
protected $act;
|
||||
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
array_unshift($bookmakers, auth()->user()->bookmaker_id);
|
||||
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function loadData($record)
|
||||
{
|
||||
$this->has_data = count($record->odds_totals_q1) ? true : false;
|
||||
|
||||
$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');
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user