wip
This commit is contained in:
1 parent
966b04dfa4
commit
29bbe52b86
1 file changed
+29
-29
+29
-29
@@ -112,37 +112,37 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
$set('competition_group_id', null);
|
||||
})
|
||||
->live(),
|
||||
// Select::make('competition_group_id')
|
||||
// ->placeholder('League')
|
||||
// ->hiddenLabel()
|
||||
// ->label('')
|
||||
// ->searchable()
|
||||
// ->options(function (Get $get) {
|
||||
// $map = Country::all()->pluck('name', 'id');
|
||||
// $query = CompetitionGroup::where('sport_id', auth()->user()->sport_id)
|
||||
// ->whereHas('event', function ($query) {
|
||||
// $query->where('starttime', '>', now())
|
||||
// ->where('betradar_id', 0);
|
||||
// });
|
||||
Select::make('competition_group_id')
|
||||
->placeholder('League')
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->searchable()
|
||||
->options(function (Get $get) {
|
||||
$map = Country::all()->pluck('name', 'id')->toArray();
|
||||
$query = CompetitionGroup::where('sport_id', auth()->user()->sport_id)
|
||||
->whereHas('event', function ($query) {
|
||||
$query->where('starttime', '>', now())
|
||||
->where('betradar_id', 0);
|
||||
});
|
||||
|
||||
// if ($get('country_id') ?? null) {
|
||||
// $res = $query->where('country_id', $get('country_id'))->get();
|
||||
// } else {
|
||||
// $res = $query->get();
|
||||
// }
|
||||
// $arr = [];
|
||||
// foreach ($res as $value) {
|
||||
// if (isset($map[$value->country_id])) {
|
||||
// $arr[$value->id] = $map[$value->country_id].' '.$value->name;
|
||||
// } else {
|
||||
// $arr[$value->id] = $value->name;
|
||||
// }
|
||||
// }
|
||||
// asort($arr);
|
||||
if ($get('country_id') ?? null) {
|
||||
$res = $query->where('country_id', $get('country_id'))->get();
|
||||
} else {
|
||||
$res = $query->get();
|
||||
}
|
||||
$arr = [];
|
||||
foreach ($res as $value) {
|
||||
if (isset($map[$value->country_id])) {
|
||||
$arr[$value->id] = $map[$value->country_id].' '.$value->name;
|
||||
} else {
|
||||
$arr[$value->id] = $value->name;
|
||||
}
|
||||
}
|
||||
asort($arr);
|
||||
|
||||
// return $arr;
|
||||
// })
|
||||
// ->live(),
|
||||
return $arr;
|
||||
})
|
||||
->live(),
|
||||
])->columnSpan(2),
|
||||
DateRangePicker::make('starttime_period')
|
||||
->displayFormat('d M Y')
|
||||
|
||||
Reference in new issue
Block a user