Removed unused query

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-11-28 15:28:37 +00:00
parent 6ae03a204b
commit 2c6b957fbe

View file

@ -53,12 +53,7 @@ class BulkAssetsController extends Controller
$asset_ids = $request->input('ids');
$assets = Asset::with('assignedTo', 'location', 'model')->find($asset_ids);
//custom fields logic
$asset_custom_field = Asset::with(['model.fieldset.fields', 'model'])->whereIn('id', $asset_ids)->whereHas('model', function ($query) {
return $query->where('fieldset_id', '!=', null);
})->get();
$models = $asset_custom_field->unique('model_id');
$models = $assets->unique('model_id');
$modelNames = [];
foreach($models as $model) {
$modelNames[] = $model->model->name;