EducationExp.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.thinkphp.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: thinkphp <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\api\validate\user;
  13. use think\Validate;
  14. /**
  15. * 验证类:用户教育经历
  16. * Class EducationExp
  17. * @package app\api\validate\user
  18. */
  19. class EducationExp extends Validate
  20. {
  21. /**
  22. * 验证规则
  23. * @var array
  24. */
  25. protected $rule = [
  26. 'education' => ['require','max:100'],
  27. 'school_name' => ['require','max:100'],
  28. 'speciality' => ['require','max:100'],
  29. 'grade'=> ['require','max:50'],
  30. ];
  31. /**
  32. * 验证提示
  33. * @var string[]
  34. */
  35. protected $message = [
  36. 'education.require' => '学历不为空',
  37. 'education.max' => '学历内容最多100字符',
  38. 'school_name.require' => '学校名称不为空',
  39. 'school_name.max' => '学校名称最多100字符',
  40. 'speciality.require' => '专业不为空',
  41. 'speciality.max' => '专业内容最多100字符',
  42. 'grade.require' => '年级不为空',
  43. 'grade.max' => '年级内容最多50字符',
  44. ];
  45. }