From 0d7a43ab389dfe3d00d337a752deaafe143bf564 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 21 Feb 2018 02:17:18 -0800 Subject: [PATCH 1/2] Fixed orderby parent location name --- app/Http/Controllers/Api/LocationsController.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/LocationsController.php b/app/Http/Controllers/Api/LocationsController.php index 5ff8fe5cc..5e8b73b08 100644 --- a/app/Http/Controllers/Api/LocationsController.php +++ b/app/Http/Controllers/Api/LocationsController.php @@ -23,7 +23,7 @@ class LocationsController extends Controller $this->authorize('view', Location::class); $allowed_columns = [ 'id','name','address','address2','city','state','country','zip','created_at', - 'updated_at','parent_id', 'manager_id','image', + 'updated_at','manager_id','image', 'assigned_assets_count','users_count','assets_count','currency']; $locations = Location::with('parent', 'manager', 'childLocations')->select([ @@ -49,11 +49,22 @@ class LocationsController extends Controller $locations = $locations->TextSearch($request->input('search')); } + + $offset = $request->input('offset', 0); $limit = $request->input('limit', 50); $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; $sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at'; - $locations->orderBy($sort, $order); + + switch ($request->input('sort')) { + case 'parent': + $locations->OrderParent($order); + break; + default: + $locations->orderBy($sort, $order); + break; + } + $total = $locations->count(); $locations = $locations->skip($offset)->take($limit)->get(); From b56082817388378e2139bbf31b3df93a92b8c5f7 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 21 Feb 2018 02:18:14 -0800 Subject: [PATCH 2/2] Bumped hash --- config/version.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/version.php b/config/version.php index 4750bc883..6a5ac629a 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v4.1.11', - 'full_app_version' => 'v4.1.11 - build 3357-gfedd2b6', - 'build_version' => '3357', + 'full_app_version' => 'v4.1.11 - build 3359-', + 'build_version' => '3359', 'prerelease_version' => '', - 'hash_version' => 'gfedd2b6', - 'full_hash' => 'v4.1.10-105-gfedd2b6', + 'hash_version' => '', + 'full_hash' => 'v4.1.11', 'branch' => 'develop', -); \ No newline at end of file +);