popup starttime client color
This commit is contained in:
1 parent
1f6420cf6b
commit
8453a624a3
1 file changed
+12
-5
@@ -6,7 +6,6 @@ use App\Models\EventBookmaker;
|
|||||||
use Filament\Support\Components\Contracts\HasEmbeddedView;
|
use Filament\Support\Components\Contracts\HasEmbeddedView;
|
||||||
use Filament\Tables\Columns\Column;
|
use Filament\Tables\Columns\Column;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class ColumnStarttime extends Column implements HasEmbeddedView
|
class ColumnStarttime extends Column implements HasEmbeddedView
|
||||||
{
|
{
|
||||||
@@ -16,16 +15,24 @@ class ColumnStarttime extends Column implements HasEmbeddedView
|
|||||||
|
|
||||||
$bookmaker_starttimes = EventBookmaker::where('event_id', $record->id)
|
$bookmaker_starttimes = EventBookmaker::where('event_id', $record->id)
|
||||||
->join('bookmakers', 'bookmakers.id', '=', 'event_bookmakers.bookmaker_id')
|
->join('bookmakers', 'bookmakers.id', '=', 'event_bookmakers.bookmaker_id')
|
||||||
->select('bookmaker_id', DB::raw('TIME(starttime) AS starttime'))
|
->select('bookmaker_id', 'starttime')
|
||||||
->orderBy('bookmakers.name')
|
->orderBy('bookmakers.name')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$pop = '<div class="grid grid-cols-2 gap-1 text-xs m-2">';
|
$pop = '<div class="grid grid-cols-2 gap-1 text-xs m-2">';
|
||||||
$pop .= '<div>TxOdds</div>';
|
$pop .= '<div>TxOdds</div>';
|
||||||
$pop .= '<div class="text-right">'.date('H:i:s', strtotime($record->starttime)).'</div>';
|
$pop .= '<div class="text-right">'.date('H:i', strtotime($record->starttime)).'</div>';
|
||||||
foreach ($bookmaker_starttimes as $value) {
|
foreach ($bookmaker_starttimes as $value) {
|
||||||
$pop .= '<div>'.$value->bookmaker->name.'</div>';
|
|
||||||
$pop .= '<div class="text-right">'.$value->starttime.'</div>';
|
$starttime = Carbon::createFromTimestamp(strtotime($value->starttime))->timezone('CET');
|
||||||
|
|
||||||
|
if ($value->bookmaker->name == auth()->user()->bookmaker->name) {
|
||||||
|
$pop .= '<div class="fi-color fi-color-info fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item">'.$value->bookmaker->name.'</div>';
|
||||||
|
$pop .= '<div class="text-right fi-color fi-color-info fi-text-color-600 dark:fi-text-color-400 fi-ta-text-item">'.$starttime->format('H:i').'</div>';
|
||||||
|
} else {
|
||||||
|
$pop .= '<div>'.$value->bookmaker->name.'</div>';
|
||||||
|
$pop .= '<div class="text-right">'.$starttime->format('H:i').'</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$pop .= '<div>';
|
$pop .= '<div>';
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user