Browse Source

refactor: 修改审核请求的字段名称和验证规则

在CoachInfoRecordController和CoachRealRecordController中,将审核请求的字段'state'更名为'info_record_state',并调整相应的验证规则,使'audit_remark'字段变为可选。这一更改提升了代码的可读性和一致性,确保审核逻辑更加清晰。
景好勇win11 2 months ago
parent
commit
a61996b3cd

+ 2 - 2
app/Admin/Controllers/CoachInfoRecordController.php

@@ -120,13 +120,13 @@ class CoachInfoRecordController extends AdminController
     {
         $validated = $request->validate([
             'id' => 'required|integer|exists:coach_info_records,id',
-            'state' => 'required|integer|in:2,3', // 2:通过 3:驳回
+            'info_record_state' => 'required|integer|in:2,3', // 2:通过 3:驳回
             'audit_remark' => 'nullable|string|max:255', // 改为可选
         ]);
 
         $result = $this->service->audit(
             $validated['id'],
-            $validated['state'],
+            $validated['info_record_state'],
             $validated['audit_remark'] ?? '', // 添加默认值
             Admin::user()->id
         );

+ 1 - 1
app/Admin/Controllers/CoachRealRecordController.php

@@ -110,7 +110,7 @@ class CoachRealRecordController extends AdminController
         $validated = $request->validate([
             'id' => 'required|integer|exists:coach_real_records,id',
             'state' => 'required|integer|in:2,3', // 2:通过 3:驳回
-            'audit_remark' => 'required|string|max:255',
+            'audit_remark' => 'string|max:255',
         ]);
 
         $result = $this->service->audit(