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

+6 -10
View File
@@ -45,7 +45,7 @@ class Odds
/**
* Delete
*/
$info = Event::where('starttime', '<', Carbon::now()->subMinutes(10)->toDateTimeString())->delete();
$info = Event::whereDate('starttime', '<', Carbon::now()->subMinutes(10))->delete();
if ($debug) {
Notice::note("Deleted: $info");
@@ -126,7 +126,7 @@ class Odds
$from_to = '&days='.Nuh::$options['days_from'].','.Nuh::$options['days_to'];
$events = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->where('group_id', Nuh::$options['gid'])->pluck('id');
$events = Event::whereDate('starttime', '>', Carbon::now())->where('group_id', Nuh::$options['gid'])->pluck('id');
foreach ($events as $event_id) {
$_calls[] = $url.$markets.$from_to.'&peid='.$event_id;
@@ -142,7 +142,7 @@ class Odds
$from_to = '&days='.Nuh::$options['days_from'].','.Nuh::$options['days_to'];
$groupids = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->groupBy('group_id')->pluck('group_id');
$groupids = Event::whereDate('starttime', '>', Carbon::now())->groupBy('group_id')->pluck('group_id');
foreach ($groupids as $groupid) {
$_calls[] = $url.$markets.$from_to.'&pgid='.$groupid;
@@ -158,11 +158,7 @@ class Odds
Notice::note("TODAY \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
$from = Carbon::now()->toDateTimeString();
$to = Carbon::now()->addDays(1)->toDateTimeString();
$res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>=', $from)->where('starttime', '<', $to)->pluck('id');
$res = Event::where('sport_id', Nuh::$options['sport_id'])->whereDate('starttime', '>=', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDays(1))->pluck('id');
foreach ($res as $id) {
$_calls[] = $url.$sport.$markets.'&peid='.$id;
@@ -178,7 +174,7 @@ class Odds
Notice::note("ONE WEEK FROM NOW \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
$res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(7)->toDateTimeString())->pluck('id');
$res = Event::where('sport_id', Nuh::$options['sport_id'])->whereDate('starttime', '>', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDays(7))->pluck('id');
foreach ($res as $id) {
$_calls[] = $url.$sport.$markets.'&peid='.$id;
@@ -194,7 +190,7 @@ class Odds
Notice::note("ALL \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
$res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>', Carbon::now()->toDateTimeString())->pluck('id');
$res = Event::where('sport_id', Nuh::$options['sport_id'])->whereDate('starttime', '>', Carbon::now())->pluck('id');
foreach ($res as $id) {
$_calls[] = $url.$sport.$markets.'&peid='.$id;