This commit is contained in:
salam committed 2026-02-27 14:41:40 +01:00
1 parent 4f2a202ec7
commit 458274b040
1 file changed
+8 -20
@@ -252,28 +252,16 @@ class EventsTable
->label('')
->multiple()
->searchable()
->options(function (Get $get) {
if ($get('country_id')) {
$res = Event::where('has_markets', 1)
->with('country')
->with('group')
->where('sport_id', auth()->user()->sport_id)
->where('country_id', $get('country_id'))
->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();
}
->options(function () {
$res = Event::where('has_markets', 1)
->with('group')
->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>', Carbon::now())
->groupBy('group_id')
->get();
$arr = [];
foreach ($res as $val) {
$arr[$val->group_id] = $val->country?->name.' '.$val->group->name;
$arr[$val->group_id] = $val->group->name;
}
asort($arr);