| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace App\Http\Requests\QuestionBank\QuestionReception;
- use App\Http\Requests\BaseRequest;
- /**
- * 挑战报名记录接口验证
- * @author 唐远望
- * @version 1.0
- * @date 2025-06-05
- *
- */
- class ChallengeRegistrationLog extends BaseRequest
- {
- /**
- * 获取应用于请求的规则
- *
- * @return array
- */
- public function rules()
- {
- // 返回结果
- return [
- 'name' => 'required',
- 'id' => 'required|integer|gt:0',
- 'status' => 'required|integer|in:0,1',
- 'page' => 'integer|min:1',
- 'limit' => 'integer|min:1',
- 'package_id' => 'required|integer|gt:0',
- 'contact_name' => 'required',
- 'contact_information' => 'required',
- 'pharmacist_type' => 'required|integer|in:1,2',
- ];
- }
- // 场景列表
- protected $scenes = [
- 'detail' => [],
- 'list' => ['page', 'limit'],
- 'add' => ['package_id','contact_name', 'contact_information','pharmacist_type'],
- 'edit' => ['id','contact_name', 'contact_information','pharmacist_type'],
- 'set_status' => ['id', 'status'],
- 'delete' => ['id'],
- ];
- /**
- * 获取已定义验证规则的错误消息
- *
- * @return array
- */
- public function messages()
- {
- return [
- 'name.required' => '名称必填',
- 'id.required' => 'ID未知',
- 'id.integer' => 'ID格式错误',
- 'id.gt' => 'ID格式错误',
- 'status.required' => '状态未知',
- 'status.integer' => '状态格式错误',
- 'status.in' => '状态格式错误',
- 'page.integer' => '页码格式错误',
- 'page.min' => '页码格式错误',
- 'limit.integer' => '每页数量格式错误',
- 'limit.min' => '每页数量格式错误',
- 'package_id.required' => '套餐ID未知',
- 'package_id.integer' => '套餐ID格式错误',
- 'package_id.gt' => '套餐ID格式错误',
- 'contact_name.required' => '联系人姓名未知',
- 'contact_information.required' => '联系方式未知',
- 'pharmacist_type.required' => '药师类型未知',
- 'pharmacist_type.integer' => '药师类型格式错误',
- 'pharmacist_type.in' => '药师类型格式错误',
- ];
- }
- }
|