Merge pull request #12040 from snipe/fixes/locations_asset_count

Renamed column back to assets_count for legacy
This commit is contained in:
snipe 2022-10-26 09:43:01 -07:00 committed by GitHub
commit 73f61ce032
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -27,7 +27,7 @@ class LocationsController extends Controller
$allowed_columns = [
'id', 'name', 'address', 'address2', 'city', 'state', 'country', 'zip', 'created_at',
'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.id',
@ -46,7 +46,7 @@ class LocationsController extends Controller
'locations.ldap_ou',
'locations.currency',
])->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('users as users_count');
@ -157,7 +157,7 @@ class LocationsController extends Controller
'locations.currency',
])
->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('users as users_count')
->findOrFail($id);

View file

@ -44,7 +44,7 @@ class LocationsTransformer
'country' => ($location->country) ? e($location->country) : null,
'zip' => ($location->zip) ? e($location->zip) : null,
'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,
'users_count' => (int) $location->users_count,
'currency' => ($location->currency) ? e($location->currency) : null,

View file

@ -51,7 +51,7 @@ class LocationPresenter extends Presenter
],
[
'field' => 'assets_location_count',
'field' => 'assets_count',
'searchable' => false,
'sortable' => true,
'switchable' => true,