mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-22 11:10:48 -08:00
Added - ability to sort by asset count in models
This commit is contained in:
parent
9293f17707
commit
68f1fa0340
|
@ -30,7 +30,7 @@ class AssetModelsController extends Controller
|
|||
public function index(Request $request)
|
||||
{
|
||||
$this->authorize('view', AssetModel::class);
|
||||
$allowed_columns = ['id','image','name','model_number','eol','notes','created_at','manufacturer'];
|
||||
$allowed_columns = ['id','image','name','model_number','eol','notes','created_at','manufacturer','assets_count'];
|
||||
|
||||
$assetmodels = AssetModel::select(['models.id','models.image','models.name','model_number','eol','models.notes','models.created_at','category_id','manufacturer_id','depreciation_id','fieldset_id', 'models.deleted_at'])
|
||||
->with('category','depreciation', 'manufacturer','fieldset')
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<th data-sortable="true" data-field="image" data-formatter="imageFormatter" data-visible="false">{{ trans('admin/hardware/table.image') }}</th>
|
||||
<th data-sortable="true" data-field="manufacturer" data-formatter="manufacturersLinkObjFormatter">{{ trans('general.manufacturer') }}</th>
|
||||
<th data-sortable="true" data-field="model_number">{{ trans('admin/models/table.modelnumber') }}</th>
|
||||
<th data-sortable="false" data-field="assets_count">{{ trans('admin/models/table.numassets') }}</th>
|
||||
<th data-sortable="true" data-field="assets_count">{{ trans('admin/models/table.numassets') }}</th>
|
||||
<th data-sortable="false" data-field="depreciation" data-formatter="depreciationsLinkObjFormatter">{{ trans('general.depreciation') }}</th>
|
||||
<th data-sortable="false" data-field="category" data-formatter="categoriesLinkObjFormatter">{{ trans('general.category') }}</th>
|
||||
<th data-sortable="true" data-field="eol">{{ trans('general.eol') }}</th>
|
||||
|
|
Loading…
Reference in a new issue