改进 关联显示

This commit is contained in:
iVampireSP.com 2022-11-20 11:58:01 +08:00
parent 0b33aef582
commit e700a3e672
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,7 @@ class WorkOrderController extends Controller
*/
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'));
}

View File

@ -41,7 +41,8 @@ class="module_name"
<a
href="{{ route('admin.hosts.edit', $workOrder->host_id) }}"
class="host_name"
host="{{ $workOrder->host_id }}">{{ $workOrder->host_id }}
host="{{ $workOrder->host_id }}">
{{ $workOrder->host->name }}
</a>
@else