修复 N+1 的问题
This commit is contained in:
parent
85d5a9186a
commit
3be7700971
@ -35,7 +35,7 @@ public function show(WorkOrder $workOrder): View
|
||||
{
|
||||
$workOrder->load(['user', 'module', 'host']);
|
||||
|
||||
$replies = (new Reply)->where('work_order_id', $workOrder->id)->latest()->paginate(100);
|
||||
$replies = (new Reply)->where('work_order_id', $workOrder->id)->with('user')->latest()->paginate(100);
|
||||
|
||||
return view('admin.work-orders.show', compact('workOrder', 'replies'));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user