mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-14 23:37:56 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
bc4c6abe06
|
@ -27,7 +27,7 @@ class LocationsController extends Controller
|
||||||
$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', 'manager_id', 'image',
|
'updated_at', 'manager_id', 'image',
|
||||||
'assigned_assets_count', 'users_count', 'assets_count','assigned_assets_count', 'assets_location_count', 'rtd_assets_count', 'currency', 'ldap_ou', ];
|
'assigned_assets_count', 'users_count', 'assets_count','assigned_assets_count', 'assets_count', 'rtd_assets_count', 'currency', 'ldap_ou', ];
|
||||||
|
|
||||||
$locations = Location::with('parent', 'manager', 'children')->select([
|
$locations = Location::with('parent', 'manager', 'children')->select([
|
||||||
'locations.id',
|
'locations.id',
|
||||||
|
@ -46,7 +46,7 @@ class LocationsController extends Controller
|
||||||
'locations.ldap_ou',
|
'locations.ldap_ou',
|
||||||
'locations.currency',
|
'locations.currency',
|
||||||
])->withCount('assignedAssets as assigned_assets_count')
|
])->withCount('assignedAssets as assigned_assets_count')
|
||||||
->withCount('assets as assets_location_count')
|
->withCount('assets as assets_count')
|
||||||
->withCount('rtd_assets as rtd_assets_count')
|
->withCount('rtd_assets as rtd_assets_count')
|
||||||
->withCount('users as users_count');
|
->withCount('users as users_count');
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ class LocationsController extends Controller
|
||||||
'locations.currency',
|
'locations.currency',
|
||||||
])
|
])
|
||||||
->withCount('assignedAssets as assigned_assets_count')
|
->withCount('assignedAssets as assigned_assets_count')
|
||||||
->withCount('assets as assets_location_count')
|
->withCount('assets as assets_count')
|
||||||
->withCount('rtd_assets as rtd_assets_count')
|
->withCount('rtd_assets as rtd_assets_count')
|
||||||
->withCount('users as users_count')
|
->withCount('users as users_count')
|
||||||
->findOrFail($id);
|
->findOrFail($id);
|
||||||
|
|
|
@ -44,7 +44,7 @@ class LocationsTransformer
|
||||||
'country' => ($location->country) ? e($location->country) : null,
|
'country' => ($location->country) ? e($location->country) : null,
|
||||||
'zip' => ($location->zip) ? e($location->zip) : null,
|
'zip' => ($location->zip) ? e($location->zip) : null,
|
||||||
'assigned_assets_count' => (int) $location->assigned_assets_count,
|
'assigned_assets_count' => (int) $location->assigned_assets_count,
|
||||||
'assets_location_count' => (int) $location->assets_location_count,
|
'assets_count' => (int) $location->assets_count,
|
||||||
'rtd_assets_count' => (int) $location->rtd_assets_count,
|
'rtd_assets_count' => (int) $location->rtd_assets_count,
|
||||||
'users_count' => (int) $location->users_count,
|
'users_count' => (int) $location->users_count,
|
||||||
'currency' => ($location->currency) ? e($location->currency) : null,
|
'currency' => ($location->currency) ? e($location->currency) : null,
|
||||||
|
|
|
@ -51,7 +51,7 @@ class LocationPresenter extends Presenter
|
||||||
],
|
],
|
||||||
|
|
||||||
[
|
[
|
||||||
'field' => 'assets_location_count',
|
'field' => 'assets_count',
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
'switchable' => true,
|
'switchable' => true,
|
||||||
|
|
Loading…
Reference in a new issue