From 3f355b1ea7f9b2b4268d3ca64a9b8c2541b4b08b Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 12 May 2021 13:36:59 +0300 Subject: [PATCH] used sortBy --- .../src/Http/Controller/MyProfileController.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php b/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php index f04312281..5eaf1f233 100644 --- a/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php +++ b/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php @@ -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); }