This commit is contained in:
Aether
2025-10-16 20:06:23 +08:00
parent 6ab9bd6198
commit 9052c7069f
8 changed files with 153 additions and 20 deletions

View File

@@ -32,7 +32,7 @@ class CampusValidator extends AetherValidator
],
'update' => [
'rules' => [
'id' => 'required|integer|min:1',
// 'id' => 'required|integer|min:1',
'name' => 'required|string|max:255',
'parent_id' => 'nullable|integer|min:0',
'level' => 'nullable|integer|in:1,2,3',
@@ -41,7 +41,7 @@ class CampusValidator extends AetherValidator
'address' => 'nullable|string|max:500',
],
'messages' => [
'id.required' => '校区ID不能为空',
// 'id.required' => '校区ID不能为空',
'name.required' => '校区名称不能为空',
'level.in' => '层级只能是1、2、3',
],

View File

@@ -32,7 +32,7 @@ class TeacherValidator extends AetherValidator
],
'update' => [
'rules' => [
'id' => 'required|integer|min:1',
// 'id' => 'required|integer|min:1',
'name' => 'nullable|string|max:50',
'age' => 'nullable|integer|min:18|max:65',
'gender' => 'nullable|integer|in:1,2',
@@ -41,7 +41,7 @@ class TeacherValidator extends AetherValidator
'teach_subject' => 'nullable|string|max:100',
],
'messages' => [
'id.required' => '教师ID不能为空',
// 'id.required' => '教师ID不能为空',
'age.min' => '年龄不能小于18岁',
'age.max' => '年龄不能大于65岁',
'gender.in' => '性别只能是1(男)或2(女)',