UserLabelCateValidate.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\validate\admin\user;
  12. use think\Validate;
  13. /**
  14. * Class UserLabelCateValidate
  15. * @package app\validate\admin\user
  16. */
  17. class UserLabelCateValidate extends Validate
  18. {
  19. /**
  20. * 定义验证规则
  21. * 格式:'字段名' => ['规则1','规则2'...]
  22. *
  23. * @var array
  24. */
  25. protected $rule = [
  26. 'name' => 'require',
  27. 'sort' => 'require|number'
  28. ];
  29. /**
  30. * 定义错误信息
  31. * 格式:'字段名.规则名' => '错误信息'
  32. *
  33. * @var array
  34. */
  35. protected $message = [
  36. 'name.require' => '请填写标签分类名称',
  37. 'sort.require' => '请填写标签分类排序',
  38. 'sort.number' => '标签分类必须为数字'
  39. ];
  40. }