TaskCheck.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. +-----------------------------------------------------------------------------------------------
  4. * GouGuOPEN [ 左手研发,右手开源,未来可期!]
  5. +-----------------------------------------------------------------------------------------------
  6. * @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
  7. +-----------------------------------------------------------------------------------------------
  8. * @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
  9. +-----------------------------------------------------------------------------------------------
  10. * @Author 勾股工作室 <hdm58@qq.com>
  11. +-----------------------------------------------------------------------------------------------
  12. */
  13. namespace app\project\validate;
  14. use think\Validate;
  15. class TaskCheck extends Validate
  16. {
  17. protected $rule = [
  18. 'title' => 'require',
  19. 'plan_hours' => 'require|regex:/^[0-9]+(.[0-9]{1,1})?$/',
  20. 'id' => 'require',
  21. ];
  22. protected $message = [
  23. 'title.require' => '任务主题不能为空',
  24. 'plan_hours.require' => '预估工时不能为空',
  25. 'plan_hours.regex' => '预估工时只能是整数或者1位小数的数字',
  26. 'id.require' => '缺少更新条件',
  27. ];
  28. protected $scene = [
  29. 'add' => ['title'],
  30. 'hours' => ['plan_hours'],
  31. 'edit' => ['id'],
  32. ];
  33. }