diff --git a/app/Console/Commands/Grapper/Fixtures/FindFixture.php b/app/Console/Commands/Grapper/Fixtures/FindFixture.php index 1223edd7..f4d0a91b 100644 --- a/app/Console/Commands/Grapper/Fixtures/FindFixture.php +++ b/app/Console/Commands/Grapper/Fixtures/FindFixture.php @@ -143,11 +143,11 @@ class FindFixture *************************************************/ if (isset($event['home_id']) && isset($event['away_id']) && isset($event['group_id'])) { - $startime = $event['starttime']; + $starttime = $event['starttime']; - $from = Carbon::createFromDate($startime)->subDay(); + $from = Carbon::createFromDate($starttime)->subDay(); - $to = Carbon::createFromDate($startime)->addDay(); + $to = Carbon::createFromDate($starttime)->addDay(); $home_id = FindFixture::$elements[$event['home_id']] ?? 0; diff --git a/app/Console/Commands/Grapper/Logifuture.php b/app/Console/Commands/Grapper/Logifuture.php index cea052fb..34d159ea 100644 --- a/app/Console/Commands/Grapper/Logifuture.php +++ b/app/Console/Commands/Grapper/Logifuture.php @@ -77,7 +77,7 @@ class Logifuture 'event_id' => $event['id'], 'sport_id' => $sport_id, 'bookmaker_id' => Nuh::$options['bookmaker_id'], - ], ['in_feed' => 1, 'bmoid' => $event['id'], 'startime' => $event['starttime']]); + ], ['in_feed' => 1, 'bmoid' => $event['id'], 'starttime' => $event['starttime']]); }, 5); switch ($sport_id) { diff --git a/app/Console/Commands/Services/Tasks/NotifyAlarms.php b/app/Console/Commands/Services/Tasks/NotifyAlarms.php index 52685efc..6c32edaf 100644 --- a/app/Console/Commands/Services/Tasks/NotifyAlarms.php +++ b/app/Console/Commands/Services/Tasks/NotifyAlarms.php @@ -82,7 +82,7 @@ class NotifyAlarms $tablecontent = [ ['key' => 'League', 'value' => $event->competition_group->name], ['key' => 'Event', 'value' => $event->home->name.' vs '.$event->away->name], - ['key' => 'Startime', 'value' => $event->starttime], + ['key' => 'Starttime', 'value' => $event->starttime], ['key' => 'Bookmaker', 'value' => $bookmaker->name], ['key' => 'Bettype', 'value' => $bet['bettype']], ['key' => 'Odd Name', 'value' => $bet['name']], @@ -128,7 +128,7 @@ class NotifyAlarms $message = '
'; $message .= '
League
'.$event->competition_group->name.'
'; $message .= '
Event
'.$event->home->name.' vs '.$event->away->name.'
'; - $message .= '
Startime
'.$event->starttime.'
'; + $message .= '
Starttime
'.$event->starttime.'
'; $message .= '
Bookmaker
'.$bookmaker->name.'
'; $message .= '
Bettype
'.$bet['bettype'].'
'; $message .= '
Odd Name
'.$bet['name'].'
'; diff --git a/app/Filament/Resources/Events/EventResource.php b/app/Filament/Resources/Events/EventResource.php index 2dfe1489..0b0c77ac 100644 --- a/app/Filament/Resources/Events/EventResource.php +++ b/app/Filament/Resources/Events/EventResource.php @@ -68,9 +68,9 @@ class EventResource extends Resource ->where('sport_id', auth()->user()->sport_id); if (config('env.app_env') == 'production') { - $query->whereDate('starttime', '>=', Carbon::now()->subHour()); + $query->where('starttime', '>=', Carbon::now()->subHour()); } else { - $query->whereDate('starttime', '>=', Carbon::now()); + $query->where('starttime', '>=', Carbon::now()); } if (auth()->user()->all_only_none > 0) { diff --git a/app/Filament/Resources/Events/Tables/EventsTable.php b/app/Filament/Resources/Events/Tables/EventsTable.php index 7e571eed..0ee425d8 100644 --- a/app/Filament/Resources/Events/Tables/EventsTable.php +++ b/app/Filament/Resources/Events/Tables/EventsTable.php @@ -7,6 +7,7 @@ use App\Filament\Resources\Events\Tables\Tools\LoadBettypeSettings; use App\Filament\Resources\Events\Tables\Tools\LoadCompareDifferences; use App\Filament\Resources\Events\Tables\Tools\LoadMultiline; use App\Filament\Tables\Columns\ColumnOdds; +use App\Filament\Tables\Columns\ColumnStarttime; use App\Filament\Tables\Columns\EventColumn; use App\Filament\Tables\Columns\MatchIds; use App\Filament\Tables\Columns\TooltipOdds; @@ -29,7 +30,6 @@ use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Filament\Schemas\Components\FusedGroup; use Filament\Schemas\Components\Utilities\Get; -use Filament\Support\Enums\FontWeight; use Filament\Support\Enums\VerticalAlignment; use Filament\Support\Enums\Width; use Filament\Tables\Columns\IconColumn; @@ -76,26 +76,7 @@ class EventsTable MatchIds::make('ids')->grow(false)->visibleFrom('xl') ->visible(fn () => auth()->user()->hasRole('super_admin')), - - TextColumn::make('event_bookmaker.starttime') - ->timezone('CET') - ->label('Start') - ->alignCenter() - ->dateTime('H:i') - ->weight(FontWeight::Bold) - ->color(function ($record) { - $bkm = $record->event_bookmaker?->starttime ?? null; - if ($bkm) { - return $bkm != $record->starttime ? 'danger' : 'info'; - } - - return 'gray'; - }) - ->state(function ($record) { - return $record->event_bookmaker->starttime ?? $record->starttime; - }) - ->description(fn ($record): string => Carbon::createFromDate($record->event_bookmaker->starttime ?? $record->starttime)->format('d. M')), - + ColumnStarttime::make('start'), TextColumn::make('country.name') ->wrap() ->hidden(fn () => auth()->user()->sport_id == 5) diff --git a/app/Filament/Tables/Columns/ColumnStarttime.php b/app/Filament/Tables/Columns/ColumnStarttime.php new file mode 100644 index 00000000..1313d5dc --- /dev/null +++ b/app/Filament/Tables/Columns/ColumnStarttime.php @@ -0,0 +1,72 @@ +getRecord(); + + $bookmaker_starttimes = EventBookmaker::with('bookmaker')->where('event_id', $record->id)->select('bookmaker_id', 'starttime')->get(); + + $pop = '
'; + $pop .= '
TxOdds
'; + $pop .= '
'.$record->starttime.'
'; + foreach ($bookmaker_starttimes as $value) { + $pop .= '
'.$value->bookmaker->name.'
'; + $pop .= '
'.$value->starttime.'
'; + } + $pop .= '
'; + + $client_starttime = $record->event_bookmaker->starttime ?? null; + $txodds_starttime = $record->starttime ?? null; + + if ($client_starttime) { + if ($client_starttime == $txodds_starttime) { + $color = 'fi-color fi-color-success fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item'; + } else { + $color = 'fi-color fi-color-warning fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item'; + } + $starttime = Carbon::createFromTimestamp(strtotime($client_starttime))->timezone('CET'); + } else { + $color = 'fi-color fi-color-info fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item'; + $starttime = Carbon::createFromTimestamp(strtotime($txodds_starttime))->timezone('CET'); + } + + ob_start(); ?> +
+ +
+
+ format('H:i')) ?> +
+
+ format('d. M')) ?> +
+
+
+
-
Startime Difference
+
Starttime Difference
{{ $e->format('d-m-y H:i') }}
@@ -52,7 +52,8 @@
- +
diff --git a/todo.md b/todo.md index ab2e7823..2dbba54c 100644 --- a/todo.md +++ b/todo.md @@ -28,4 +28,9 @@ Bookmakers Starting Times https://txodds.com/feed/starting_times.php?ident=betaid1&passwd=Dy59vpRC&date=today Tracking OTB (Off-the-board) Offers -https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC&last=1769508445 \ No newline at end of file +https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC&last=1769508445 + + +UPDATE TO v5 +plugins not supporting v5 yet: +joaopaulolndev/filament-edit-profile \ No newline at end of file