优化代码

This commit is contained in:
iVampireSP.com 2022-11-22 19:08:31 +08:00
commit 792c2ce6ca
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 9 additions and 7 deletions

View File

@ -71,10 +71,12 @@ public function update(Request $request, WorkOrder $workOrder): RedirectResponse
//
$request->validate([
'title' => 'required|string|max:255',
'status' => 'required|string|in:open,closed,read,user_read,replied,user_replied,on_hold,in_progress',
]);
$workOrder->update($request->all());
$workOrder->update([
'status' => $request->status
]);
return back()->with('success', '工单更新成功');
}

View File

@ -36,7 +36,11 @@
<a href="{{ route('admin.users.edit', $host->user_id) }}"> {{ $host->user->name }}</a>
</td>
<td>
{{ $host->price }}
@if ($host->managed_price !== null)
<span class="text-danger">{{ $host->managed_price }}</span>
@else
{{ $host->price }}
@endif
</td>
<td>
{{ $host->created_at }}
@ -57,8 +61,4 @@
{{-- 分页 --}}
{{ $hosts->links() }}
@endsection