mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
used sortBy
This commit is contained in:
parent
05012d64b9
commit
3f355b1ea7
@ -275,18 +275,7 @@ class MyProfileController extends PublicController
|
|||||||
public function changeEducation(Request $request)
|
public function changeEducation(Request $request)
|
||||||
{
|
{
|
||||||
if ($request->info == 'education') {
|
if ($request->info == 'education') {
|
||||||
$education = DB::table('profile_education_part')
|
$education = EducationPartModel::query()->where('education_id', $request->education)->get()->sortBy('name');
|
||||||
->leftJoin(
|
|
||||||
'profile_education_part_translations',
|
|
||||||
'profile_education_part.id',
|
|
||||||
'=',
|
|
||||||
'profile_education_part_translations.entry_id'
|
|
||||||
)
|
|
||||||
->where('profile_education_part_translations.locale', '=', Request()->session()->get('_locale', setting_value('streams::default_locale')))
|
|
||||||
->where('education_id', $request->education)
|
|
||||||
->selectRaw('default_profile_education_part.*, default_profile_education_part_translations.name as name')
|
|
||||||
->orderBy('name', 'ASC')
|
|
||||||
->get();
|
|
||||||
}
|
}
|
||||||
return response()->json(['data' => $education], 200);
|
return response()->json(['data' => $education], 200);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user