1
0

DailyWork.php 624 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\api\validate;
  3. use think\Validate;
  4. class DailyWork extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. 'current_work' => 'require',
  9. 'reporting_object' => 'require',
  10. 'type' => 'in:day,week,month',
  11. ];
  12. // 验证消息
  13. protected $message = [
  14. 'current_work.require' => '请填写汇报内容',
  15. 'reporting_object.require' => '请选择汇报对象',
  16. 'type.in' => '未获取到日报类型',
  17. ];
  18. // 验证场景
  19. protected $scene = [
  20. 'submit_daily' => ['current_work', 'reporting_object', 'type'],
  21. ];
  22. }