Brand.php 836 B

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