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

+1 -1
View File
@@ -18,7 +18,7 @@ class AlarmStatistic
$events = Event::with('event_bookmaker')
->where('sport_id', auth()->user()->sport_id)
->whereDate('starttime', '>=', Carbon::now())
->where('starttime', '>=', Carbon::now())
->whereHas('event_bookmaker', function ($query) {
$query->where('bookmaker_id', auth()->user()->bookmaker_id);
})
+3 -3
View File
@@ -30,7 +30,7 @@ class Bet365All
foreach ($sports as $sport_id) {
$mappers = Mapper::where('provider_id', 2)->where('sport_id', $sport_id)->whereDate('starttime', '>', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDays(10))->get()->toArray();
$mappers = Mapper::where('provider_id', 2)->where('sport_id', $sport_id)->where('starttime', '>=', Carbon::now())->where('starttime', '<', Carbon::now()->addDays(10))->get()->toArray();
foreach ($mappers as $mapper) {
@@ -47,8 +47,8 @@ class Bet365All
$from = Carbon::createFromDate($mapper['starttime'])->subDay();
$to = Carbon::createFromDate($mapper['starttime'])->addDay();
$event = Event::whereDate('starttime', '>', $from)
->whereDate('starttime', '<', $to)
$event = Event::where('starttime', '>', $from)
->where('starttime', '<', $to)
->where('home_id', $mapper['txodds_home_id'])
->where('away_id', $mapper['txodds_away_id'])
->where('competition_group_id', $mapper['txodds_group_id'])
@@ -25,7 +25,7 @@ class LogifutureColombiaAll
Notice::note(Nuh::$options['name'].' '.Nuh::$options['sport'], 'g');
}
$mappers = Mapper::where('provider_id', 2)->where('sport_id', 5)->whereDate('starttime', '>', Carbon::now())->get()->toArray();
$mappers = Mapper::where('provider_id', 2)->where('sport_id', 5)->where('starttime', '>=', Carbon::now())->get()->toArray();
foreach ($mappers as $mapper) {
@@ -42,8 +42,8 @@ class LogifutureColombiaAll
$from = Carbon::createFromDate($mapper['starttime'])->subDay();
$to = Carbon::createFromDate($mapper['starttime'])->addDay();
$event = Event::whereDate('starttime', '>', $from)
->whereDate('starttime', '<', $to)
$event = Event::where('starttime', '>', $from)
->where('starttime', '<', $to)
->where('home_id', $mapper['txodds_home_id'])
->where('away_id', $mapper['txodds_away_id'])
->where('competition_group_id', $mapper['txodds_group_id'])
@@ -25,7 +25,7 @@ class LogifutureNigeriaAll
Notice::note(Nuh::$options['name'].' '.Nuh::$options['sport'], 'g');
}
$mappers = Mapper::where('provider_id', 2)->where('sport_id', 5)->whereDate('starttime', '>', Carbon::now())->get()->toArray();
$mappers = Mapper::where('provider_id', 2)->where('sport_id', 5)->where('starttime', '>=', Carbon::now())->get()->toArray();
foreach ($mappers as $mapper) {
@@ -42,8 +42,8 @@ class LogifutureNigeriaAll
$from = Carbon::createFromDate($mapper['starttime'])->subDay();
$to = Carbon::createFromDate($mapper['starttime'])->addDay();
$event = Event::whereDate('starttime', '>', $from)
->whereDate('starttime', '<', $to)
$event = Event::where('starttime', '>', $from)
->where('starttime', '<', $to)
->where('home_id', $mapper['txodds_home_id'])
->where('away_id', $mapper['txodds_away_id'])
->where('competition_group_id', $mapper['txodds_group_id'])
@@ -32,7 +32,7 @@ class MaglooKeniaAll
foreach ($sports as $sport_id) {
$mappers = Mapper::where('provider_id', $provider_id)->where('sport_id', $sport_id)->whereDate('starttime', '>', Carbon::now())->get()->toArray();
$mappers = Mapper::where('provider_id', $provider_id)->where('sport_id', $sport_id)->where('starttime', '>=', Carbon::now())->get()->toArray();
foreach ($mappers as $mapper) {
@@ -49,8 +49,8 @@ class MaglooKeniaAll
$from = Carbon::createFromDate($mapper['starttime'])->subDay();
$to = Carbon::createFromDate($mapper['starttime'])->addDay();
$event = Event::whereDate('starttime', '>', $from)
->whereDate('starttime', '<', $to)
$event = Event::where('starttime', '>', $from)
->where('starttime', '<', $to)
->where('home_id', $mapper['txodds_home_id'])
->where('away_id', $mapper['txodds_away_id'])
->where('competition_group_id', $mapper['txodds_group_id'])
@@ -28,7 +28,7 @@ class MaglooNigeriaAll
$sports = Sport::map('magl');
$mappers = Mapper::where('provider_id', 2)->where('sport_id', 5)->whereDate('starttime', '>', Carbon::now())->get()->toArray();
$mappers = Mapper::where('provider_id', 2)->where('sport_id', 5)->where('starttime', '>=', Carbon::now())->get()->toArray();
foreach ($mappers as $mapper) {
@@ -45,8 +45,8 @@ class MaglooNigeriaAll
$from = Carbon::createFromDate($mapper['starttime'])->subDay();
$to = Carbon::createFromDate($mapper['starttime'])->addDay();
$event = Event::whereDate('starttime', '>', $from)
->whereDate('starttime', '<', $to)
$event = Event::where('starttime', '>', $from)
->where('starttime', '<', $to)
->where('home_id', $mapper['txodds_home_id'])
->where('away_id', $mapper['txodds_away_id'])
->where('competition_group_id', $mapper['txodds_group_id'])
@@ -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) {
@@ -161,8 +161,8 @@ class FindFixture
->where('home_id', $home_id)
->where('away_id', $away_id)
->where('competition_group_id', $competition_group_id)
->whereDate('starttime', '>', $from)
->whereDate('starttime', '<', $to)
->where('starttime', '>', $from)
->where('starttime', '<', $to)
->value('id');
if ($match_id) {
+6 -6
View File
@@ -45,7 +45,7 @@ class Odds
/**
* Delete
*/
$info = Event::whereDate('starttime', '<', Carbon::now()->subMinutes(10))->delete();
$info = Event::where('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::whereDate('starttime', '>', Carbon::now())->where('group_id', Nuh::$options['gid'])->pluck('id');
$events = Event::where('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::whereDate('starttime', '>', Carbon::now())->groupBy('group_id')->pluck('group_id');
$groupids = Event::where('starttime', '>', Carbon::now())->groupBy('group_id')->pluck('group_id');
foreach ($groupids as $groupid) {
$_calls[] = $url.$markets.$from_to.'&pgid='.$groupid;
@@ -158,7 +158,7 @@ class Odds
Notice::note("TODAY \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
$res = Event::where('sport_id', Nuh::$options['sport_id'])->whereDate('starttime', '>=', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDays(1))->pluck('id');
$res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>=', Carbon::now())->where('starttime', '<', Carbon::now()->addDays(1))->pluck('id');
foreach ($res as $id) {
$_calls[] = $url.$sport.$markets.'&peid='.$id;
@@ -174,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'])->whereDate('starttime', '>', Carbon::now())->whereDate('starttime', '<', Carbon::now()->addDays(7))->pluck('id');
$res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>=', Carbon::now())->where('starttime', '<', Carbon::now()->addDays(7))->pluck('id');
foreach ($res as $id) {
$_calls[] = $url.$sport.$markets.'&peid='.$id;
@@ -190,7 +190,7 @@ class Odds
Notice::note("ALL \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
$res = Event::where('sport_id', Nuh::$options['sport_id'])->whereDate('starttime', '>', Carbon::now())->pluck('id');
$res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>=', Carbon::now())->pluck('id');
foreach ($res as $id) {
$_calls[] = $url.$sport.$markets.'&peid='.$id;
@@ -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');
+10 -10
View File
@@ -117,15 +117,15 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
$from = Carbon::createFromDate($timeframe['start']);
$end = Carbon::createFromDate($timeframe['end']);
$query->whereDate('starttime', '>=', $from)->whereDate('starttime', '<=', $end);
$query->where('starttime', '>=', $from)->where('starttime', '<=', $end);
} elseif (isset($timeframe['start'])) {
$from = Carbon::createFromDate($timeframe['start']);
$query->whereDate('starttime', '>=', $from);
$query->where('starttime', '>=', $from);
} elseif (isset($timeframe['end'])) {
$end = Carbon::createFromDate($timeframe['end']);
$query->whereDate('starttime', '<=', $end);
$query->where('starttime', '<=', $end);
}
}
@@ -161,15 +161,15 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
$from = Carbon::createFromDate($timeframe['start']);
$end = Carbon::createFromDate($timeframe['end']);
$query->whereDate('starttime', '>=', $from)->whereDate('starttime', '<=', $end);
$query->where('starttime', '>=', $from)->where('starttime', '<=', $end);
} elseif (isset($timeframe['start'])) {
$from = Carbon::createFromDate($timeframe['start']);
$query->whereDate('starttime', '>=', $from);
$query->where('starttime', '>=', $from);
} elseif (isset($timeframe['end'])) {
$end = Carbon::createFromDate($timeframe['end']);
$query->whereDate('starttime', '<=', $end);
$query->where('starttime', '<=', $end);
}
});
}
@@ -225,18 +225,18 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
$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);
}
});
})->indicateUsing(function (): array {
+13 -13
View File
@@ -119,15 +119,15 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
$from = Carbon::createFromDate($timeframe['start']);
$end = Carbon::createFromDate($timeframe['end']);
$query->whereDate('starttime', '>=', $from)->whereDate('starttime', '<=', $end);
$query->where('starttime', '>=', $from)->where('starttime', '<=', $end);
} elseif (isset($timeframe['start'])) {
$from = Carbon::createFromDate($timeframe['start']);
$query->whereDate('starttime', '>=', $from);
$query->where('starttime', '>=', $from);
} elseif (isset($timeframe['end'])) {
$end = Carbon::createFromDate($timeframe['end']);
$query->whereDate('starttime', '<=', $end);
$query->where('starttime', '<=', $end);
}
}
@@ -155,15 +155,15 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
$from = Carbon::createFromDate($timeframe['start']);
$end = Carbon::createFromDate($timeframe['end']);
$query->whereDate('starttime', '>=', $from)->whereDate('starttime', '<=', $end);
$query->where('starttime', '>=', $from)->where('starttime', '<=', $end);
} elseif (isset($timeframe['start'])) {
$from = Carbon::createFromDate($timeframe['start']);
$query->whereDate('starttime', '>=', $from);
$query->where('starttime', '>=', $from);
} elseif (isset($timeframe['end'])) {
$end = Carbon::createFromDate($timeframe['end']);
$query->whereDate('starttime', '<=', $end);
$query->where('starttime', '<=', $end);
}
}
if ($get('country_id') ?? null) {
@@ -201,15 +201,15 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
$from = Carbon::createFromDate($timeframe['start']);
$end = Carbon::createFromDate($timeframe['end']);
$query->whereDate('starttime', '>=', $from)->whereDate('starttime', '<=', $end);
$query->where('starttime', '>=', $from)->where('starttime', '<=', $end);
} elseif (isset($timeframe['start'])) {
$from = Carbon::createFromDate($timeframe['start']);
$query->whereDate('starttime', '>=', $from);
$query->where('starttime', '>=', $from);
} elseif (isset($timeframe['end'])) {
$end = Carbon::createFromDate($timeframe['end']);
$query->whereDate('starttime', '<=', $end);
$query->where('starttime', '<=', $end);
}
}
@@ -251,18 +251,18 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
$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);
}
});
})->indicateUsing(function (): array {