Merge branch 'develop'
# Conflicts: # config/version.php
This commit is contained in:
commit
97bd87773c
2 changed files with 17 additions and 6 deletions
|
@ -23,7 +23,7 @@ class LocationsController extends Controller
|
||||||
$this->authorize('view', Location::class);
|
$this->authorize('view', Location::class);
|
||||||
$allowed_columns = [
|
$allowed_columns = [
|
||||||
'id','name','address','address2','city','state','country','zip','created_at',
|
'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'];
|
'assigned_assets_count','users_count','assets_count','currency'];
|
||||||
|
|
||||||
$locations = Location::with('parent', 'manager', 'childLocations')->select([
|
$locations = Location::with('parent', 'manager', 'childLocations')->select([
|
||||||
|
@ -49,11 +49,22 @@ class LocationsController extends Controller
|
||||||
$locations = $locations->TextSearch($request->input('search'));
|
$locations = $locations->TextSearch($request->input('search'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$offset = $request->input('offset', 0);
|
$offset = $request->input('offset', 0);
|
||||||
$limit = $request->input('limit', 50);
|
$limit = $request->input('limit', 50);
|
||||||
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
||||||
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
|
$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();
|
$total = $locations->count();
|
||||||
$locations = $locations->skip($offset)->take($limit)->get();
|
$locations = $locations->skip($offset)->take($limit)->get();
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
return array (
|
return array (
|
||||||
'app_version' => 'v4.1.11',
|
'app_version' => 'v4.1.11',
|
||||||
'full_app_version' => 'v4.1.11 - build 3357-gfedd2b6',
|
'full_app_version' => 'v4.1.11 - build 3359-',
|
||||||
'build_version' => '3357',
|
'build_version' => '3359',
|
||||||
'prerelease_version' => '',
|
'prerelease_version' => '',
|
||||||
'hash_version' => 'gfedd2b6',
|
'hash_version' => '',
|
||||||
'full_hash' => 'v4.1.11-105-gfedd2b6',
|
'full_hash' => 'v4.1.11',
|
||||||
'branch' => 'master',
|
'branch' => 'master',
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue