12345678910111213141516171819202122232425262728 |
- <?php
- namespace app\api\validate;
- use think\Validate;
- class DailyWork extends Validate
- {
- // 验证规则
- protected $rule = [
- 'current_work' => 'require',
- 'reporting_object' => 'require',
- 'type' => 'in:day,week,month',
- ];
- // 验证消息
- protected $message = [
- 'current_work.require' => '请填写汇报内容',
- 'reporting_object.require' => '请选择汇报对象',
- 'type.in' => '未获取到日报类型',
- ];
- // 验证场景
- protected $scene = [
- 'submit_daily' => ['current_work', 'reporting_object', 'type'],
- ];
- }
|