Fleaclass.php 763 B

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