Brand.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 验证器
  13. */
  14. class Brand extends Validate
  15. {
  16. protected $rule = [
  17. 'brand_name' => 'require',
  18. 'brand_initial' => 'require',
  19. 'brand_sort' => 'require|number'
  20. ];
  21. protected $message = [
  22. 'brand_name.require' => '品牌名称不能为空',
  23. 'brand_initial.require' => '请填写首字母',
  24. 'brand_sort.require' => '排序仅可以为数字',
  25. 'brand_sort.number' => '排序仅可以为数字'
  26. ];
  27. protected $scene = [
  28. 'brand_add' => ['brand_name', 'brand_initial', 'brand_sort'],
  29. 'brand_edit' => ['brand_name', 'brand_initial', 'brand_sort'],
  30. ];
  31. }