revert wip starttime
This commit is contained in:
Hermann Telser committed 2026-02-25 14:38:44 +01:00
1 parent e48365cd9b
commit 3e3330bf80
7 files changed
+47 -125

No files matched your search

+1 -1
View File
@@ -77,7 +77,7 @@ class Logifuture
'event_id' => $event['id'], 'event_id' => $event['id'],
'sport_id' => $sport_id, 'sport_id' => $sport_id,
'bookmaker_id' => Nuh::$options['bookmaker_id'], 'bookmaker_id' => Nuh::$options['bookmaker_id'],
], ['in_feed' => 1, 'bmoid' => $event['id'], 'starttime' => $event['starttime']]); ], ['in_feed' => 1, 'bmoid' => $event['id'], 'startime' => $event['starttime']]);
}, 5); }, 5);
switch ($sport_id) { switch ($sport_id) {
@@ -7,7 +7,6 @@ use App\Filament\Resources\Events\Tables\Tools\LoadBettypeSettings;
use App\Filament\Resources\Events\Tables\Tools\LoadCompareDifferences; use App\Filament\Resources\Events\Tables\Tools\LoadCompareDifferences;
use App\Filament\Resources\Events\Tables\Tools\LoadMultiline; use App\Filament\Resources\Events\Tables\Tools\LoadMultiline;
use App\Filament\Tables\Columns\ColumnOdds; use App\Filament\Tables\Columns\ColumnOdds;
use App\Filament\Tables\Columns\ColumnStarttime;
use App\Filament\Tables\Columns\EventColumn; use App\Filament\Tables\Columns\EventColumn;
use App\Filament\Tables\Columns\MatchIds; use App\Filament\Tables\Columns\MatchIds;
use App\Filament\Tables\Columns\TooltipOdds; use App\Filament\Tables\Columns\TooltipOdds;
@@ -32,6 +31,7 @@ use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput; use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\FusedGroup; use Filament\Schemas\Components\FusedGroup;
use Filament\Schemas\Components\Utilities\Get; use Filament\Schemas\Components\Utilities\Get;
use Filament\Support\Enums\FontWeight;
use Filament\Support\Enums\VerticalAlignment; use Filament\Support\Enums\VerticalAlignment;
use Filament\Support\Enums\Width; use Filament\Support\Enums\Width;
use Filament\Tables\Columns\IconColumn; use Filament\Tables\Columns\IconColumn;
@@ -43,6 +43,7 @@ use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\HtmlString;
class EventsTable class EventsTable
{ {
@@ -79,24 +80,24 @@ class EventsTable
MatchIds::make('ids')->grow(false)->visibleFrom('xl') MatchIds::make('ids')->grow(false)->visibleFrom('xl')
->visible(fn () => auth()->user()->hasRole('super_admin')), ->visible(fn () => auth()->user()->hasRole('super_admin')),
ColumnStarttime::make('starttime')->label('Start'), 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';
}
// TextColumn::make('event_bookmaker.starttime') return 'gray';
// ->timezone('CET') })
// ->label('Start') ->state(function ($record) {
// ->alignCenter() return $record->event_bookmaker->starttime ?? $record->starttime;
// ->dateTime('H:i') })
// ->color(function ($record) { ->description(fn ($record): string => Carbon::createFromDate($record->event_bookmaker->starttime ?? $record->starttime)->format('d. M')),
// $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') TextColumn::make('country.name')
->wrap() ->wrap()
@@ -211,6 +212,7 @@ class EventsTable
->prefixIcon('phosphor-flag') ->prefixIcon('phosphor-flag')
->hiddenLabel() ->hiddenLabel()
->label('') ->label('')
->multiple()
->searchable() ->searchable()
->preload() ->preload()
->options(function () { ->options(function () {
@@ -233,7 +235,7 @@ class EventsTable
->searchable() ->searchable()
->options(function (Get $get) { ->options(function (Get $get) {
if ($get('country_id')) { 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'))->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'))->whereDate('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get();
} else { } 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(); $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();
} }
@@ -464,8 +466,12 @@ class EventsTable
})->indicateUsing(function (array $data): array { })->indicateUsing(function (array $data): array {
$indicators = []; $indicators = [];
if ($data['country_id'] ?? null) { if ($data['country_id'] ?? null) {
$countries = Country::where('id', $data['country_id'])->pluck('name')->toArray(); $countries = Country::whereIn('id', $data['country_id'])->pluck('name')->toArray();
$indicators[] = Indicator::make('Countries: '.implode(', ', $countries))->removeField('country_id')->color('warning'); 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');
}
} }
if ($data['group_id'] ?? null) { if ($data['group_id'] ?? null) {
@@ -693,10 +699,10 @@ class EventsTable
])->iconButton() ])->iconButton()
->icon('phosphor-dots-three-vertical'), ->icon('phosphor-dots-three-vertical'),
])->toolbarActions([ // ])->toolbarActions([
BulkActionGroup::make([ // BulkActionGroup::make([
DeleteBulkAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')), // DeleteBulkAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')),
]), // ]),
]); ]);
} }
} }
@@ -1,47 +0,0 @@
<?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
View File
@@ -3017,16 +3017,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v12.53.0", "version": "v12.52.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "f57f035c0d34503d9ff30be76159bb35a003cd1f" "reference": "d5511fa74f4608dbb99864198b1954042aa8d5a7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/f57f035c0d34503d9ff30be76159bb35a003cd1f", "url": "https://api.github.com/repos/laravel/framework/zipball/d5511fa74f4608dbb99864198b1954042aa8d5a7",
"reference": "f57f035c0d34503d9ff30be76159bb35a003cd1f", "reference": "d5511fa74f4608dbb99864198b1954042aa8d5a7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3235,7 +3235,7 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2026-02-24T14:35:15+00:00" "time": "2026-02-17T17:07:04+00:00"
}, },
{ {
"name": "laravel/prompts", "name": "laravel/prompts",
@@ -3298,16 +3298,16 @@
}, },
{ {
"name": "laravel/serializable-closure", "name": "laravel/serializable-closure",
"version": "v2.0.10", "version": "v2.0.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/serializable-closure.git", "url": "https://github.com/laravel/serializable-closure.git",
"reference": "870fc81d2f879903dfc5b60bf8a0f94a1609e669" "reference": "8f631589ab07b7b52fead814965f5a800459cb3e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/870fc81d2f879903dfc5b60bf8a0f94a1609e669", "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/8f631589ab07b7b52fead814965f5a800459cb3e",
"reference": "870fc81d2f879903dfc5b60bf8a0f94a1609e669", "reference": "8f631589ab07b7b52fead814965f5a800459cb3e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3355,7 +3355,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues", "issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure" "source": "https://github.com/laravel/serializable-closure"
}, },
"time": "2026-02-20T19:59:49+00:00" "time": "2026-02-03T06:55:34+00:00"
}, },
{ {
"name": "laravel/tinker", "name": "laravel/tinker",
@@ -13299,12 +13299,12 @@
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": {}, "stability-flags": [],
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^8.3" "php": "^8.3"
}, },
"platform-dev": {}, "platform-dev": [],
"plugin-api-version": "2.9.0" "plugin-api-version": "2.6.0"
} }
+1 -1
View File
@@ -65,7 +65,7 @@ return [
| |
*/ */
'timezone' => env('APP_TIMEZONE', 'Europe/Vienna'), 'timezone' => env('APP_TIMEZONE', 'UTC'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -1,37 +0,0 @@
@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 }} --}}
+1 -1
View File
@@ -10,7 +10,7 @@ case "$1" in
# echo "DISABLED" # echo "DISABLED"
# exit; # exit;
echo "" echo ""
echo "! THIS WILL DROP ALL TABLES !" echo "! THIS WILL TROP ALL TABLES !"
echo "" echo ""
echo "you want to do that?" echo "you want to do that?"
echo "10 sec to think OR" echo "10 sec to think OR"