wip starttime
This commit is contained in:
1 parent
34c0cb4ba4
commit
e48365cd9b
7 files changed
+125
-47
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
@@ -31,7 +32,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;
|
||||
@@ -43,7 +43,6 @@ use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
class EventsTable
|
||||
{
|
||||
@@ -80,24 +79,24 @@ 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';
|
||||
}
|
||||
ColumnStarttime::make('starttime')->label('Start'),
|
||||
|
||||
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')),
|
||||
// TextColumn::make('event_bookmaker.starttime')
|
||||
// ->timezone('CET')
|
||||
// ->label('Start')
|
||||
// ->alignCenter()
|
||||
// ->dateTime('H:i')
|
||||
// ->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;
|
||||
// }),
|
||||
|
||||
TextColumn::make('country.name')
|
||||
->wrap()
|
||||
@@ -212,7 +211,6 @@ class EventsTable
|
||||
->prefixIcon('phosphor-flag')
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->multiple()
|
||||
->searchable()
|
||||
->preload()
|
||||
->options(function () {
|
||||
@@ -235,7 +233,7 @@ class EventsTable
|
||||
->searchable()
|
||||
->options(function (Get $get) {
|
||||
if ($get('country_id')) {
|
||||
$res = Event::where('has_markets', 1)->where('sport_id', auth()->user()->sport_id)->with('country')->with('competition_group')->where('country_id', $get('country_id'))->whereDate('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get();
|
||||
$res = Event::where('has_markets', 1)->where('sport_id', auth()->user()->sport_id)->with('country')->with('competition_group')->where('country_id', $get('country_id'))->groupBy('competition_group_id')->get();
|
||||
} else {
|
||||
$res = Event::where('has_markets', 1)->where('sport_id', auth()->user()->sport_id)->with('country')->with('competition_group')->whereDate('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get();
|
||||
}
|
||||
@@ -466,12 +464,8 @@ class EventsTable
|
||||
})->indicateUsing(function (array $data): array {
|
||||
$indicators = [];
|
||||
if ($data['country_id'] ?? null) {
|
||||
$countries = Country::whereIn('id', $data['country_id'])->pluck('name')->toArray();
|
||||
if (count($countries) > 1) {
|
||||
$indicators[] = Indicator::make('Countries: '.implode(', ', $countries))->removeField('country_id')->color('warning');
|
||||
} else {
|
||||
$indicators[] = Indicator::make('Country: '.$countries[0])->removeField('country_id')->color('warning');
|
||||
}
|
||||
$countries = Country::where('id', $data['country_id'])->pluck('name')->toArray();
|
||||
$indicators[] = Indicator::make('Countries: '.implode(', ', $countries))->removeField('country_id')->color('warning');
|
||||
}
|
||||
|
||||
if ($data['group_id'] ?? null) {
|
||||
@@ -699,10 +693,10 @@ class EventsTable
|
||||
|
||||
])->iconButton()
|
||||
->icon('phosphor-dots-three-vertical'),
|
||||
// ])->toolbarActions([
|
||||
// BulkActionGroup::make([
|
||||
// DeleteBulkAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')),
|
||||
// ]),
|
||||
])->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use Filament\Tables\Columns\Column;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class ColumnStarttime extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-starttime';
|
||||
|
||||
protected $starttime;
|
||||
|
||||
protected $tx;
|
||||
|
||||
protected $cl;
|
||||
|
||||
protected $color;
|
||||
|
||||
public function setTime($record)
|
||||
{
|
||||
$this->tx = Carbon::createFromTimestamp(strtotime($record->starttime));
|
||||
if ($record->event_bookmaker?->starttime) {
|
||||
$this->cl = Carbon::createFromTimestamp(strtotime($record->event_bookmaker?->starttime));
|
||||
$this->starttime = Carbon::createFromTimestamp(strtotime($record->event_bookmaker?->starttime));
|
||||
|
||||
if ($this->tx == $this->cl) {
|
||||
$this->color = 'text-green-600';
|
||||
} else {
|
||||
$this->color = 'text-orange-600';
|
||||
}
|
||||
} else {
|
||||
$this->color = 'text-blue-600';
|
||||
$this->starttime = Carbon::createFromTimestamp(strtotime($record->starttime));
|
||||
}
|
||||
}
|
||||
|
||||
public function getColor()
|
||||
{
|
||||
return $this->color;
|
||||
}
|
||||
|
||||
public function getStarttime()
|
||||
{
|
||||
return $this->starttime;
|
||||
}
|
||||
}
|
||||
Generated
+13
-13
@@ -3017,16 +3017,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v12.52.0",
|
||||
"version": "v12.53.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "d5511fa74f4608dbb99864198b1954042aa8d5a7"
|
||||
"reference": "f57f035c0d34503d9ff30be76159bb35a003cd1f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/d5511fa74f4608dbb99864198b1954042aa8d5a7",
|
||||
"reference": "d5511fa74f4608dbb99864198b1954042aa8d5a7",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/f57f035c0d34503d9ff30be76159bb35a003cd1f",
|
||||
"reference": "f57f035c0d34503d9ff30be76159bb35a003cd1f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3235,7 +3235,7 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2026-02-17T17:07:04+00:00"
|
||||
"time": "2026-02-24T14:35:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/prompts",
|
||||
@@ -3298,16 +3298,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
"version": "v2.0.9",
|
||||
"version": "v2.0.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/serializable-closure.git",
|
||||
"reference": "8f631589ab07b7b52fead814965f5a800459cb3e"
|
||||
"reference": "870fc81d2f879903dfc5b60bf8a0f94a1609e669"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/8f631589ab07b7b52fead814965f5a800459cb3e",
|
||||
"reference": "8f631589ab07b7b52fead814965f5a800459cb3e",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/870fc81d2f879903dfc5b60bf8a0f94a1609e669",
|
||||
"reference": "870fc81d2f879903dfc5b60bf8a0f94a1609e669",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3355,7 +3355,7 @@
|
||||
"issues": "https://github.com/laravel/serializable-closure/issues",
|
||||
"source": "https://github.com/laravel/serializable-closure"
|
||||
},
|
||||
"time": "2026-02-03T06:55:34+00:00"
|
||||
"time": "2026-02-20T19:59:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/tinker",
|
||||
@@ -13299,12 +13299,12 @@
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"stability-flags": {},
|
||||
"prefer-stable": true,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": "^8.3"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.6.0"
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.9.0"
|
||||
}
|
||||
+1
-1
@@ -65,7 +65,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => env('APP_TIMEZONE', 'UTC'),
|
||||
'timezone' => env('APP_TIMEZONE', 'Europe/Vienna'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
@php
|
||||
$setTime($record);
|
||||
$starttime = $getStarttime();
|
||||
$color = $getColor();
|
||||
@endphp
|
||||
<div {{ $getExtraAttributeBag() }} class="my-auto my-auto">
|
||||
<div x-data="{ pop: 'Hallo' }">
|
||||
<template x-ref="template">
|
||||
<p x-html="pop"></p>
|
||||
</template>
|
||||
|
||||
<div class="flex flex-col gap-0 text-sm {{ $color }} shadow"
|
||||
x-tooltip.html="{ content: () =>
|
||||
$refs.template.innerHTML,
|
||||
placement: 'auto',
|
||||
allowHTML: true,
|
||||
theme: $store.theme,
|
||||
class: 'tooltip',
|
||||
appendTo: $root,
|
||||
strategy: 'fixed',
|
||||
interactive: false,
|
||||
zIndex: 99999,
|
||||
popperOptions: {
|
||||
strategy: 'fixed',
|
||||
},
|
||||
}">
|
||||
<div class="text-center font-bold">
|
||||
{{ $starttime->format('H:i') }}
|
||||
</div>
|
||||
<div class="text-center">
|
||||
{{ $starttime->format('d.M') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- {{ $getState() }}
|
||||
{{ $getRecord()->starttime }} --}}
|
||||
Reference in new issue
Block a user