comparatore bookmaker odds wip
This commit is contained in:
1 parent
adaec7b3dc
commit
218c1e6e1c
59 files changed
+470
-129
No files matched your search
@@ -6,6 +6,7 @@ use App\Filament\Resources\Events\Pages\ListEvents;
|
||||
use App\Filament\Resources\Events\Schemas\EventForm;
|
||||
use App\Filament\Resources\Events\Tables\EventsTable;
|
||||
use App\Models\Event;
|
||||
use App\Models\Multiline;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
@@ -57,14 +58,24 @@ class EventResource extends Resource
|
||||
|
||||
public static function getNavigationBadge(): ?string
|
||||
{
|
||||
return parent::getEloquentQuery()->withoutGlobalScopes()->where('starttime', '>', Carbon::now())->count();
|
||||
return parent::getEloquentQuery()
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->where('starttime', '>', Carbon::now())
|
||||
->count();
|
||||
}
|
||||
|
||||
public static function getEloquentQuery(): Builder
|
||||
{
|
||||
// $_bookmaker = Multiline::where('sport_id', auth()->user()->sport_id)
|
||||
// ->where('client_id', auth()->user()->client_id)
|
||||
// ->where('bettype_id', 1)
|
||||
// ->where('matchpart_id', 1)
|
||||
// ->pluck('bookmaker_id')
|
||||
// ->toArray();
|
||||
|
||||
return parent::getEloquentQuery()
|
||||
// ->join('odds_3ways', 'odds_3ways.event_id', '=', 'events.id')
|
||||
->where('starttime', '>', Carbon::now())
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->withoutGlobalScopes()->with('odds_3way');
|
||||
->where('sport_id', auth()->user()->sport_id);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ class EventsTable
|
||||
->width('1rem')
|
||||
->size(IconSize::ExtraLarge)
|
||||
->icon(fn ($record) => $record->sport->icon)
|
||||
->tooltip(fn ($record) => $record->txodds_id),
|
||||
->tooltip(fn ($record) => $record->id),
|
||||
TextColumn::make('txodds_id')->searchable()->label('Match Id')->badge()->copyable(),
|
||||
TextColumn::make('starttime')
|
||||
->label('Start')
|
||||
@@ -41,7 +41,8 @@ class EventsTable
|
||||
->description(fn ($record) => $record->competition_group->name),
|
||||
TextColumn::make('home.name')->alignRight()->searchable(),
|
||||
TextColumn::make('away.name')->searchable(),
|
||||
Odds3Way::make('3way')->label('1 X 2')->alignCenter(),
|
||||
|
||||
Odds3Way::make('odds_3way')->label('Market 1X2'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user