mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Eager load asset query on maintenances to prevent n+1 queries
This commit is contained in:
parent
7992258b46
commit
3a81b7e612
|
@ -309,7 +309,7 @@ class AssetMaintenancesController extends Controller
|
|||
'' => 'Select an improvement type',
|
||||
] + AssetMaintenance::getImprovementOptions();
|
||||
|
||||
$assets = Company::scopeCompanyables(Asset::all(), 'assets.company_id')->lists('detailed_name', 'id');
|
||||
$assets = Company::scopeCompanyables(Asset::with('model','assignedUser')->get(), 'assets.company_id')->lists('detailed_name', 'id');
|
||||
// Get Supplier List
|
||||
$supplier_list = Helper::suppliersList();
|
||||
|
||||
|
|
Loading…
Reference in a new issue