select whereDate to where

This commit is contained in:
salam committed 2026-02-25 17:14:56 +01:00
1 parent 79271f22e1
commit d58d543583
15 files changed
+61 -61

No files matched your search

@@ -50,7 +50,7 @@ class EventResource extends Resource
return parent::getEloquentQuery()
->where('has_markets', 1)
->where('sport_id', auth()->user()->sport_id)
->whereDate('starttime', '>=', Carbon::now())
->where('starttime', '>=', Carbon::now())
->count();
}
@@ -348,18 +348,18 @@ class EventsTable
$end = Carbon::createFromDate($starttime_period['end']);
return $query
->whereDate('starttime', '>=', $from)
->whereDate('starttime', '<=', $end);
->where('starttime', '>=', $from)
->where('starttime', '<=', $end);
} elseif (isset($starttime_period['start'])) {
$from = Carbon::createFromDate($starttime_period['start']);
return $query
->whereDate('starttime', '>=', $from);
->where('starttime', '>=', $from);
} elseif (isset($starttime_period['end'])) {
$end = Carbon::createFromDate($starttime_period['end']);
return $query
->whereDate('starttime', '<=', $end);
->where('starttime', '<=', $end);
}
}
)->when(
@@ -530,10 +530,10 @@ class EventsTable
$span = $data['starttime_period'];
$text = '';
if ($span['start'] ?? null) {
$text .= 'From '.Carbon::parse($span['start'])->toFormattedDateString();
$text .= Carbon::parse($span['start'])->format('d. M.');
}
if ($span['end'] ?? null) {
$text .= ' To '.Carbon::parse($span['end'])->toFormattedDateString();
$text .= ' - '.Carbon::parse($span['end'])->format('d. M.');
}
if ($text) {
$indicators[] = Indicator::make($text)->removeField('starttime_period.start')->color('warning');