all where to whereDate for starttime

This commit is contained in:
salam committed 2026-02-22 17:08:41 +01:00
1 parent dcaf503b71
commit 831c8507cf
16 files changed
+66 -71

No files matched your search

@@ -38,12 +38,12 @@ class Odds
if ($single) {
$events = Event::where('id', Nuh::$options['id'])->where('betsapi_id', '>', 0)->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
} elseif ($today) {
$events = Event::where('sport_id', Nuh::$options['sport_id'])->where('betsapi_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDay()->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
$events = Event::where('sport_id', Nuh::$options['sport_id'])->where('betsapi_id', '>', 0)->whereDate('starttime', '>', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDay())->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
} elseif ($week) {
$events = Event::where('sport_id', Nuh::$options['sport_id'])->where('betsapi_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(7)->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
$events = Event::where('sport_id', Nuh::$options['sport_id'])->where('betsapi_id', '>', 0)->whereDate('starttime', '>', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDays(7))->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
} else {
// all
$events = Event::where('sport_id', Nuh::$options['sport_id'])->where('betsapi_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
$events = Event::where('sport_id', Nuh::$options['sport_id'])->where('betsapi_id', '>', 0)->whereDate('starttime', '>', Carbon::now())->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
}
foreach ($events as $key => $event) {