Update ModuleController.php
修复 N+1 的问题
This commit is contained in:
parent
39ecbfb70c
commit
98b94c24e5
@ -77,7 +77,7 @@ public function show(Module $module): View
|
|||||||
{
|
{
|
||||||
$years = $module->calculate();
|
$years = $module->calculate();
|
||||||
|
|
||||||
$hosts = Host::where('module_id', $module->id)->latest()->paginate(50);
|
$hosts = Host::where('module_id', $module->id)->with('user')->latest()->paginate(50);
|
||||||
|
|
||||||
return view('admin.modules.show', compact('module', 'years', 'hosts'));
|
return view('admin.modules.show', compact('module', 'years', 'hosts'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user