mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Merge pull request #12943 from marcusmoore/fixes/avoid-loading-unused-models-for-report
Remove the loading of asset maintenances that are not used by view
This commit is contained in:
commit
914b2658cc
|
@ -36,7 +36,7 @@ class AssetMaintenancesController extends Controller
|
||||||
{
|
{
|
||||||
$this->authorize('view', Asset::class);
|
$this->authorize('view', Asset::class);
|
||||||
|
|
||||||
$maintenances = AssetMaintenance::select('asset_maintenances.*')->with('asset', 'asset.model', 'asset.location', 'supplier', 'asset.company', 'admin');
|
$maintenances = AssetMaintenance::select('asset_maintenances.*')->with('asset', 'asset.model', 'asset.location', 'asset.defaultLoc', 'supplier', 'asset.company', 'admin');
|
||||||
|
|
||||||
if ($request->filled('search')) {
|
if ($request->filled('search')) {
|
||||||
$maintenances = $maintenances->TextSearch($request->input('search'));
|
$maintenances = $maintenances->TextSearch($request->input('search'));
|
||||||
|
|
|
@ -898,12 +898,8 @@ class ReportsController extends Controller
|
||||||
public function getAssetMaintenancesReport()
|
public function getAssetMaintenancesReport()
|
||||||
{
|
{
|
||||||
$this->authorize('reports.view');
|
$this->authorize('reports.view');
|
||||||
// Grab all the improvements
|
|
||||||
$assetMaintenances = AssetMaintenance::with('asset', 'supplier', 'asset.company')
|
|
||||||
->orderBy('created_at', 'DESC')
|
|
||||||
->get();
|
|
||||||
|
|
||||||
return view('reports/asset_maintenances', compact('assetMaintenances'));
|
return view('reports.asset_maintenances');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue