wip
This commit is contained in:
1 parent
4f2a202ec7
commit
458274b040
1 file changed
+8
-20
@@ -252,28 +252,16 @@ class EventsTable
|
|||||||
->label('')
|
->label('')
|
||||||
->multiple()
|
->multiple()
|
||||||
->searchable()
|
->searchable()
|
||||||
->options(function (Get $get) {
|
->options(function () {
|
||||||
if ($get('country_id')) {
|
$res = Event::where('has_markets', 1)
|
||||||
$res = Event::where('has_markets', 1)
|
->with('group')
|
||||||
->with('country')
|
->where('sport_id', auth()->user()->sport_id)
|
||||||
->with('group')
|
->where('starttime', '>', Carbon::now())
|
||||||
->where('sport_id', auth()->user()->sport_id)
|
->groupBy('group_id')
|
||||||
->where('country_id', $get('country_id'))
|
->get();
|
||||||
->where('starttime', '>', Carbon::now())
|
|
||||||
->groupBy('group_id')
|
|
||||||
->get();
|
|
||||||
} else {
|
|
||||||
$res = Event::where('has_markets', 1)
|
|
||||||
->with('country')
|
|
||||||
->with('group')
|
|
||||||
->where('sport_id', auth()->user()->sport_id)
|
|
||||||
->where('starttime', '>', Carbon::now())
|
|
||||||
->groupBy('group_id')
|
|
||||||
->get();
|
|
||||||
}
|
|
||||||
$arr = [];
|
$arr = [];
|
||||||
foreach ($res as $val) {
|
foreach ($res as $val) {
|
||||||
$arr[$val->group_id] = $val->country?->name.' '.$val->group->name;
|
$arr[$val->group_id] = $val->group->name;
|
||||||
}
|
}
|
||||||
asort($arr);
|
asort($arr);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user