diff --git a/app/Http/Controllers/Admin/ModuleController.php b/app/Http/Controllers/Admin/ModuleController.php index 7995dbc..c4320bc 100644 --- a/app/Http/Controllers/Admin/ModuleController.php +++ b/app/Http/Controllers/Admin/ModuleController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; +use App\Models\Host; use App\Models\Module; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; @@ -86,7 +87,9 @@ public function show(Module $module): View { $years = $module->calculate(); - return view('admin.modules.show', compact('module', 'years')); + $hosts = Host::where('module_id', $module->id)->latest()->paginate(50); + + return view('admin.modules.show', compact('module', 'years', 'hosts')); } /** diff --git a/resources/views/admin/hosts/index.blade.php b/resources/views/admin/hosts/index.blade.php index 5626e5d..f902dae 100644 --- a/resources/views/admin/hosts/index.blade.php +++ b/resources/views/admin/hosts/index.blade.php @@ -25,7 +25,7 @@ - {{ $host->module_id }} diff --git a/resources/views/admin/modules/show.blade.php b/resources/views/admin/modules/show.blade.php index af2abeb..264fbe8 100644 --- a/resources/views/admin/modules/show.blade.php +++ b/resources/views/admin/modules/show.blade.php @@ -7,6 +7,51 @@ 编辑

收益

- +
+ +

主机

+
+ + + + + + + + + + + + @foreach ($hosts as $host) + + + + + + + + + + @endforeach + +
ID名称用户创建时间更新时间操作
+ + {{ $host->id }} + + + {{ $host->name }} + + {{ $host->user->name }} + + {{ $host->created_at }} + + {{ $host->updated_at }} + + 编辑 +
+
+ + {{-- 分页 --}} + {{ $hosts->links() }} @endsection diff --git a/resources/views/admin/work-orders/index.blade.php b/resources/views/admin/work-orders/index.blade.php index 3a6a89a..21734bd 100644 --- a/resources/views/admin/work-orders/index.blade.php +++ b/resources/views/admin/work-orders/index.blade.php @@ -10,6 +10,7 @@ ID 标题 模块 + 主机 发起者 状态 操作 @@ -35,6 +36,17 @@ class="module_name" module="{{ $workOrder->module_id }}">{{ $workOrder->module_id }} + + @if ($workOrder->host_id) + {{ $workOrder->host_id }} + + @else + 无 + @endif + {{ $workOrder->user->name }}