3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-05 20:35:31 +00:00

Updated withCount to use manual naming

This commit is contained in:
snipe
2019-05-22 00:52:51 -07:00
parent df8008f1ed
commit 4be8ba9f17
17 changed files with 29 additions and 30 deletions

View File

@ -373,7 +373,7 @@ class AssetModelsController extends Controller
if ((is_array($models_raw_array)) && (count($models_raw_array) > 0)) {
$models = AssetModel::whereIn('id', $models_raw_array)->withCount('assets')->orderBy('assets_count', 'ASC')->get();
$models = AssetModel::whereIn('id', $models_raw_array)->withCount('assets as assets_count')->orderBy('assets_count', 'ASC')->get();
// If deleting....
if ($request->input('bulk_actions')=='delete') {
@ -461,7 +461,7 @@ class AssetModelsController extends Controller
if ((is_array($models_raw_array)) && (count($models_raw_array) > 0)) {
$models = AssetModel::whereIn('id', $models_raw_array)->withCount('assets')->get();
$models = AssetModel::whereIn('id', $models_raw_array)->withCount('assets as assets_count')->get();
$del_error_count = 0;
$del_count = 0;