Fleaclass.php 997 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 验证器
  13. */
  14. class Fleaclass extends Validate
  15. {
  16. protected $rule = [
  17. 'fleaclass_name' => 'require',
  18. 'fleaclass_sort' => 'require|number'
  19. ];
  20. protected $message = [
  21. 'fleaclass_name.require' => '分类名称不能为空',
  22. 'fleaclass_sort.require' => '分类排序仅能为数字',
  23. 'fleaclass_sort.number' => '分类排序仅能为数字'
  24. ];
  25. protected $scene = [
  26. 'goods_class_add' => ['fleaclass_name', 'fleaclass_sort'],
  27. 'goods_class_edit' => ['fleaclass_name', 'fleaclass_sort'],
  28. ];
  29. }