select whereDate to where
This commit is contained in:
1 parent
79271f22e1
commit
d58d543583
15 files changed
+61
-61
No files matched your search
@@ -61,12 +61,12 @@ class Bet365
|
||||
if ($single) {
|
||||
$events = Event::where('id', Nuh::$options['id'])->where('bet365_id', '>', 0)->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
} elseif ($today) {
|
||||
$events = Event::where('sport_id', $sport_id)->where('bet365_id', '>', 0)->whereDate('starttime', '>', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDay())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
$events = Event::where('sport_id', $sport_id)->where('bet365_id', '>', 0)->where('starttime', '>=', Carbon::now())->where('starttime', '<', Carbon::now()->addDay())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
} elseif ($week) {
|
||||
$events = Event::where('sport_id', $sport_id)->where('bet365_id', '>', 0)->whereDate('starttime', '>', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDays(7))->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
$events = Event::where('sport_id', $sport_id)->where('bet365_id', '>', 0)->where('starttime', '>=', Carbon::now())->where('starttime', '<', Carbon::now()->addDays(7))->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
} else {
|
||||
// all
|
||||
$events = Event::where('sport_id', $sport_id)->where('bet365_id', '>', 0)->whereDate('starttime', '>', Carbon::now())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
$events = Event::where('sport_id', $sport_id)->where('bet365_id', '>', 0)->where('starttime', '>=', Carbon::now())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
}
|
||||
if ($events ?? null && $debug) {
|
||||
Notice::note('No events', 'r');
|
||||
|
||||
@@ -24,7 +24,7 @@ class Fixtures
|
||||
/**
|
||||
* Delete Started
|
||||
*/
|
||||
$info = Mapper::whereDate('starttime', '<', Carbon::now()->subHours(24))->delete();
|
||||
$info = Mapper::where('starttime', '<', Carbon::now()->subHours(24))->delete();
|
||||
|
||||
if ($debug) {
|
||||
Notice::note("Deleted: $info");
|
||||
|
||||
@@ -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)->whereDate('starttime', '>', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDay())->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
|
||||
$events = Event::where('sport_id', Nuh::$options['sport_id'])->where('betsapi_id', '>', 0)->where('starttime', '>=', Carbon::now())->where('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)->whereDate('starttime', '>', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDays(7))->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
|
||||
$events = Event::where('sport_id', Nuh::$options['sport_id'])->where('betsapi_id', '>', 0)->where('starttime', '>=', Carbon::now())->where('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)->whereDate('starttime', '>', Carbon::now())->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
|
||||
$events = Event::where('sport_id', Nuh::$options['sport_id'])->where('betsapi_id', '>', 0)->where('starttime', '>=', Carbon::now())->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
|
||||
}
|
||||
|
||||
foreach ($events as $key => $event) {
|
||||
|
||||
Reference in new issue
Block a user