mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -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)
|
||||
{
|
||||
if ($request->info == 'education') {
|
||||
$education = DB::table('profile_education_part')
|
||||
->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();
|
||||
$education = EducationPartModel::query()->where('education_id', $request->education)->get()->sortBy('name');
|
||||
}
|
||||
return response()->json(['data' => $education], 200);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user