wip
This commit is contained in:
1 parent
cb20a72fcb
commit
ed182bcb4d
1 file changed
+9
-9
@@ -195,7 +195,7 @@ class EventsTable
|
|||||||
->options(function () {
|
->options(function () {
|
||||||
$res = Event::where('has_markets', 1)
|
$res = Event::where('has_markets', 1)
|
||||||
->where('sport_id', auth()->user()->sport_id)
|
->where('sport_id', auth()->user()->sport_id)
|
||||||
->whereDate('starttime', '>=', Carbon::now())
|
->where('starttime', '>=', Carbon::now())
|
||||||
->groupBy('country_id')
|
->groupBy('country_id')
|
||||||
->pluck('country_id')->toArray();
|
->pluck('country_id')->toArray();
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ class EventsTable
|
|||||||
->with('country')
|
->with('country')
|
||||||
->with('competition_group')
|
->with('competition_group')
|
||||||
->where('sport_id', auth()->user()->sport_id)
|
->where('sport_id', auth()->user()->sport_id)
|
||||||
->whereDate('starttime', '>', Carbon::now())
|
->where('starttime', '>', Carbon::now())
|
||||||
->whereIn('country_id', $get('country_id'))
|
->whereIn('country_id', $get('country_id'))
|
||||||
->groupBy('competition_group_id')->get();
|
->groupBy('competition_group_id')->get();
|
||||||
} else {
|
} else {
|
||||||
@@ -227,8 +227,8 @@ class EventsTable
|
|||||||
->with('country')
|
->with('country')
|
||||||
->with('competition_group')
|
->with('competition_group')
|
||||||
->where('sport_id', auth()->user()->sport_id)
|
->where('sport_id', auth()->user()->sport_id)
|
||||||
->whereDate('starttime', '>', Carbon::now())
|
->where('starttime', '>', Carbon::now())
|
||||||
->groupBy('competition_group_id')->get();
|
->groupBy('competition_group.id')->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
$arr = [];
|
$arr = [];
|
||||||
@@ -253,7 +253,7 @@ class EventsTable
|
|||||||
$res = Event::where('has_markets', 1)
|
$res = Event::where('has_markets', 1)
|
||||||
->with('competition_group')
|
->with('competition_group')
|
||||||
->where('sport_id', auth()->user()->sport_id)
|
->where('sport_id', auth()->user()->sport_id)
|
||||||
->whereDate('starttime', '>', Carbon::now())
|
->where('starttime', '>', Carbon::now())
|
||||||
->groupBy('competition_group_id')
|
->groupBy('competition_group_id')
|
||||||
->get();
|
->get();
|
||||||
$arr = [];
|
$arr = [];
|
||||||
@@ -330,18 +330,18 @@ class EventsTable
|
|||||||
$end = Carbon::createFromDate($starttime_period['end']);
|
$end = Carbon::createFromDate($starttime_period['end']);
|
||||||
|
|
||||||
return $query
|
return $query
|
||||||
->whereDate('starttime', '>=', $from)
|
->where('starttime', '>=', $from)
|
||||||
->whereDate('starttime', '<=', $end);
|
->where('starttime', '<=', $end);
|
||||||
} elseif (isset($starttime_period['start'])) {
|
} elseif (isset($starttime_period['start'])) {
|
||||||
$from = Carbon::createFromDate($starttime_period['start']);
|
$from = Carbon::createFromDate($starttime_period['start']);
|
||||||
|
|
||||||
return $query
|
return $query
|
||||||
->whereDate('starttime', '>=', $from);
|
->where('starttime', '>=', $from);
|
||||||
} elseif (isset($starttime_period['end'])) {
|
} elseif (isset($starttime_period['end'])) {
|
||||||
$end = Carbon::createFromDate($starttime_period['end']);
|
$end = Carbon::createFromDate($starttime_period['end']);
|
||||||
|
|
||||||
return $query
|
return $query
|
||||||
->whereDate('starttime', '<=', $end);
|
->where('starttime', '<=', $end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)->when(
|
)->when(
|
||||||
|
|||||||
Reference in new issue
Block a user