popup time order by bookmaker name
This commit is contained in:
1 parent
5a44fc18b3
commit
79271f22e1
2 files changed
+30
-29
No files matched your search
@@ -6,6 +6,7 @@ use App\Models\EventBookmaker;
|
||||
use Filament\Support\Components\Contracts\HasEmbeddedView;
|
||||
use Filament\Tables\Columns\Column;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class ColumnStarttime extends Column implements HasEmbeddedView
|
||||
{
|
||||
@@ -13,14 +14,18 @@ class ColumnStarttime extends Column implements HasEmbeddedView
|
||||
{
|
||||
$record = $this->getRecord();
|
||||
|
||||
$bookmaker_starttimes = EventBookmaker::with('bookmaker')->where('event_id', $record->id)->select('bookmaker_id', 'starttime')->get();
|
||||
$bookmaker_starttimes = EventBookmaker::where('event_id', $record->id)
|
||||
->join('bookmakers', 'bookmakers.id', '=', 'event_bookmakers.bookmaker_id')
|
||||
->select('bookmaker_id', DB::raw('TIME(starttime) AS starttime'))
|
||||
->orderBy('bookmakers.name')
|
||||
->get();
|
||||
|
||||
$pop = '<div class="grid grid-cols-2 gap-1">';
|
||||
$pop = '<div class="grid grid-cols-2 gap-1 text-xs m-2">';
|
||||
$pop .= '<div>TxOdds</div>';
|
||||
$pop .= '<div>'.$record->starttime.'</div>';
|
||||
$pop .= '<div class="text-right">'.date('H:i:s', strtotime($record->starttime)).'</div>';
|
||||
foreach ($bookmaker_starttimes as $value) {
|
||||
$pop .= '<div>'.$value->bookmaker->name.'</div>';
|
||||
$pop .= '<div>'.$value->starttime.'</div>';
|
||||
$pop .= '<div class="text-right">'.$value->starttime.'</div>';
|
||||
}
|
||||
$pop .= '<div>';
|
||||
|
||||
|
||||
Reference in new issue
Block a user