all where to whereDate for starttime
This commit is contained in:
1 parent
dcaf503b71
commit
831c8507cf
16 files changed
+66
-71
No files matched your search
@@ -22,7 +22,7 @@ class LoadEvents
|
||||
->with('home')
|
||||
->with('away')
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->where('starttime', '>', Carbon::now())
|
||||
->whereDate('starttime', '>', Carbon::now())
|
||||
->where(function ($query) use ($element_ids) {
|
||||
$query->orWhereIn('home_id', $element_ids)->orWhereIn('away_id', $element_ids);
|
||||
});
|
||||
@@ -31,7 +31,7 @@ class LoadEvents
|
||||
->with('home')
|
||||
->with('away')
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->where('starttime', '>', Carbon::now());
|
||||
->whereDate('starttime', '>', Carbon::now());
|
||||
}
|
||||
|
||||
switch (Auth::user()->provider_id) {
|
||||
|
||||
@@ -19,7 +19,7 @@ class LoadProvider
|
||||
if (is_array($search_values) and \count($search_values)) {
|
||||
|
||||
return Mapper::query()
|
||||
->where('starttime', '>', Carbon::now())
|
||||
->whereDate('starttime', '>', Carbon::now())
|
||||
->where('sport_id', $user->sport_id)
|
||||
->where('provider_id', $user->provider_id)
|
||||
->where(function ($query) use ($search_values) {
|
||||
@@ -31,7 +31,7 @@ class LoadProvider
|
||||
|
||||
} else {
|
||||
return Mapper::query()
|
||||
->where('starttime', '>', Carbon::now())
|
||||
->whereDate('starttime', '>', Carbon::now())
|
||||
->where('sport_id', $user->sport_id)
|
||||
->where('provider_id', $user->provider_id);
|
||||
}
|
||||
|
||||
+12
-12
@@ -113,7 +113,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
->searchable()
|
||||
->preload()
|
||||
->options(function (Get $get) {
|
||||
$query = Event::query()->where('sport_id', auth()->user()->sport_id)->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->groupBy('country_id');
|
||||
$query = Event::query()->where('sport_id', auth()->user()->sport_id)->where('betradar_id', 0)->whereDate('starttime', '>', Carbon::now())->groupBy('country_id');
|
||||
|
||||
$timeframe = $get('starttime_period') ?? [];
|
||||
|
||||
@@ -122,15 +122,15 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
$from = Carbon::createFromDate($timeframe['start']);
|
||||
$end = Carbon::createFromDate($timeframe['end']);
|
||||
|
||||
$query->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'))->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '>=', $from)->whereDate('starttime', '<=', $end);
|
||||
} elseif (isset($timeframe['start'])) {
|
||||
$from = Carbon::createFromDate($timeframe['start']);
|
||||
|
||||
$query->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '>=', $from);
|
||||
} elseif (isset($timeframe['end'])) {
|
||||
$end = Carbon::createFromDate($timeframe['end']);
|
||||
|
||||
$query->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '<=', $end);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
|
||||
$query = CompetitionGroup::where('sport_id', auth()->user()->sport_id)
|
||||
->whereHas('event', function ($query) {
|
||||
$query->where('starttime', '>', now())
|
||||
$query->whereDate('starttime', '>', now())
|
||||
->where('betradar_id', 0);
|
||||
});
|
||||
|
||||
@@ -167,15 +167,15 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
$from = Carbon::createFromDate($timeframe['start']);
|
||||
$end = Carbon::createFromDate($timeframe['end']);
|
||||
|
||||
$query->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'))->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '>=', $from)->whereDate('starttime', '<=', $end);
|
||||
} elseif (isset($timeframe['start'])) {
|
||||
$from = Carbon::createFromDate($timeframe['start']);
|
||||
|
||||
$query->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '>=', $from);
|
||||
} elseif (isset($timeframe['end'])) {
|
||||
$end = Carbon::createFromDate($timeframe['end']);
|
||||
|
||||
$query->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '<=', $end);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -231,18 +231,18 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
$end = Carbon::createFromDate($starttime_period['end']);
|
||||
|
||||
return $query
|
||||
->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'))
|
||||
->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
->whereDate('starttime', '>=', $from)
|
||||
->whereDate('starttime', '<=', $end);
|
||||
} elseif (isset($starttime_period['start'])) {
|
||||
$from = Carbon::createFromDate($starttime_period['start']);
|
||||
|
||||
return $query
|
||||
->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'));
|
||||
->whereDate('starttime', '>=', $from);
|
||||
} elseif (isset($starttime_period['end'])) {
|
||||
$end = Carbon::createFromDate($starttime_period['end']);
|
||||
|
||||
return $query
|
||||
->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
->whereDate('starttime', '<=', $end);
|
||||
}
|
||||
});
|
||||
})->indicateUsing(function (): array {
|
||||
|
||||
@@ -110,7 +110,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
->preload()
|
||||
->live()
|
||||
->options(function (Get $get) {
|
||||
$query = Mapper::query()->where('sport_id', auth()->user()->sport_id)->where('provider_id', auth()->user()->provider_id)->where('starttime', '>', Carbon::now())->groupBy('country_id')->orderBy('country');
|
||||
$query = Mapper::query()->where('sport_id', auth()->user()->sport_id)->where('provider_id', auth()->user()->provider_id)->whereDate('starttime', '>', Carbon::now())->groupBy('country_id')->orderBy('country');
|
||||
|
||||
$timeframe = $get('starttime_period') ?? [];
|
||||
if ($timeframe['start'] || $timeframe['end']) {
|
||||
@@ -118,15 +118,15 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
$from = Carbon::createFromDate($timeframe['start']);
|
||||
$end = Carbon::createFromDate($timeframe['end']);
|
||||
|
||||
$query->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'))->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '>=', $from)->whereDate('starttime', '<=', $end);
|
||||
} elseif (isset($timeframe['start'])) {
|
||||
$from = Carbon::createFromDate($timeframe['start']);
|
||||
|
||||
$query->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '>=', $from);
|
||||
} elseif (isset($timeframe['end'])) {
|
||||
$end = Carbon::createFromDate($timeframe['end']);
|
||||
|
||||
$query->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '<=', $end);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
->preload()
|
||||
->live()
|
||||
->options(function (Get $get) {
|
||||
$query = Mapper::query()->where('sport_id', auth()->user()->sport_id)->where('provider_id', auth()->user()->provider_id)->where('starttime', '>', Carbon::now())->groupBy('group_cc');
|
||||
$query = Mapper::query()->where('sport_id', auth()->user()->sport_id)->where('provider_id', auth()->user()->provider_id)->whereDate('starttime', '>', Carbon::now())->groupBy('group_cc');
|
||||
|
||||
$timeframe = $get('starttime_period') ?? [];
|
||||
|
||||
@@ -154,15 +154,15 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
$from = Carbon::createFromDate($timeframe['start']);
|
||||
$end = Carbon::createFromDate($timeframe['end']);
|
||||
|
||||
$query->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'))->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '>=', $from)->whereDate('starttime', '<=', $end);
|
||||
} elseif (isset($timeframe['start'])) {
|
||||
$from = Carbon::createFromDate($timeframe['start']);
|
||||
|
||||
$query->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '>=', $from);
|
||||
} elseif (isset($timeframe['end'])) {
|
||||
$end = Carbon::createFromDate($timeframe['end']);
|
||||
|
||||
$query->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '<=', $end);
|
||||
}
|
||||
}
|
||||
if ($get('country_id') ?? null) {
|
||||
@@ -187,11 +187,11 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
->preload()
|
||||
->options(function (Get $get) {
|
||||
if ($get('country_id')) {
|
||||
$query = Mapper::query()->where('sport_id', auth()->user()->sport_id)->where('provider_id', auth()->user()->provider_id)->where('starttime', '>', Carbon::now())->where('country_id', $get('country_id'))->groupBy('group_id');
|
||||
$query = Mapper::query()->where('sport_id', auth()->user()->sport_id)->where('provider_id', auth()->user()->provider_id)->whereDate('starttime', '>', Carbon::now())->where('country_id', $get('country_id'))->groupBy('group_id');
|
||||
} elseif ($get('group_cc')) {
|
||||
$query = Mapper::query()->where('sport_id', auth()->user()->sport_id)->where('provider_id', auth()->user()->provider_id)->where('starttime', '>', Carbon::now())->where('group_cc', $get('group_cc'))->groupBy('group_id');
|
||||
$query = Mapper::query()->where('sport_id', auth()->user()->sport_id)->where('provider_id', auth()->user()->provider_id)->whereDate('starttime', '>', Carbon::now())->where('group_cc', $get('group_cc'))->groupBy('group_id');
|
||||
} else {
|
||||
$query = Mapper::query()->where('sport_id', auth()->user()->sport_id)->where('provider_id', auth()->user()->provider_id)->where('starttime', '>', Carbon::now())->groupBy('group_id');
|
||||
$query = Mapper::query()->where('sport_id', auth()->user()->sport_id)->where('provider_id', auth()->user()->provider_id)->whereDate('starttime', '>', Carbon::now())->groupBy('group_id');
|
||||
}
|
||||
|
||||
$timeframe = $get('starttime_period') ?? [];
|
||||
@@ -200,15 +200,15 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
$from = Carbon::createFromDate($timeframe['start']);
|
||||
$end = Carbon::createFromDate($timeframe['end']);
|
||||
|
||||
$query->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'))->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '>=', $from)->whereDate('starttime', '<=', $end);
|
||||
} elseif (isset($timeframe['start'])) {
|
||||
$from = Carbon::createFromDate($timeframe['start']);
|
||||
|
||||
$query->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '>=', $from);
|
||||
} elseif (isset($timeframe['end'])) {
|
||||
$end = Carbon::createFromDate($timeframe['end']);
|
||||
|
||||
$query->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
$query->whereDate('starttime', '<=', $end);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,18 +250,18 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
$end = Carbon::createFromDate($starttime_period['end']);
|
||||
|
||||
return $query
|
||||
->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'))
|
||||
->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
->whereDate('starttime', '>=', $from)
|
||||
->whereDate('starttime', '<=', $end);
|
||||
} elseif (isset($starttime_period['start'])) {
|
||||
$from = Carbon::createFromDate($starttime_period['start']);
|
||||
|
||||
return $query
|
||||
->whereDate('starttime', '>=', $from->format('Y-m-d 00:00:00'));
|
||||
->whereDate('starttime', '>=', $from);
|
||||
} elseif (isset($starttime_period['end'])) {
|
||||
$end = Carbon::createFromDate($starttime_period['end']);
|
||||
|
||||
return $query
|
||||
->whereDate('starttime', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
->whereDate('starttime', '<=', $end);
|
||||
}
|
||||
});
|
||||
})->indicateUsing(function (): array {
|
||||
|
||||
Reference in new issue
Block a user