Storegrade.php 818 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. *
  6. *
  7. * ----------------------------------------------------------------------------
  8. *
  9. * 验证器
  10. */
  11. class Storegrade extends Validate
  12. {
  13. protected $rule = [
  14. 'storegrade_name' => 'require',
  15. 'storegrade_sort' => 'require|number|between:1,255'
  16. ];
  17. protected $message = [
  18. 'storegrade_name.require' => '店铺等级名称必填',
  19. 'storegrade_sort.require' => '排序为必填',
  20. 'storegrade_sort.number' => '排序必须是数字',
  21. 'storegrade_sort.between' => '等级级别不能大于255'
  22. ];
  23. protected $scene = [
  24. 'add' => ['storegrade_name', 'storegrade_sort'],
  25. 'edit' => ['storegrade_name', 'storegrade_sort'],
  26. ];
  27. }