改进 关联显示
This commit is contained in:
parent
0b33aef582
commit
e700a3e672
@ -21,7 +21,7 @@ class WorkOrderController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(WorkOrder $workOrder): View
|
public function index(WorkOrder $workOrder): View
|
||||||
{
|
{
|
||||||
$workOrders = $workOrder->with('user')->latest()->paginate(100);
|
$workOrders = $workOrder->with(['user', 'host'])->latest()->paginate(100);
|
||||||
return view('admin.work-orders.index', compact('workOrders'));
|
return view('admin.work-orders.index', compact('workOrders'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,8 @@ class="module_name"
|
|||||||
<a
|
<a
|
||||||
href="{{ route('admin.hosts.edit', $workOrder->host_id) }}"
|
href="{{ route('admin.hosts.edit', $workOrder->host_id) }}"
|
||||||
class="host_name"
|
class="host_name"
|
||||||
host="{{ $workOrder->host_id }}">{{ $workOrder->host_id }}
|
host="{{ $workOrder->host_id }}">
|
||||||
|
{{ $workOrder->host->name }}
|
||||||
</a>
|
</a>
|
||||||
@else
|
@else
|
||||||
无
|
无
|
||||||
|
Loading…
Reference in New Issue
Block a user