Book.php 548 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\admin\validate;
  3. use think\Validate;
  4. class Book extends Validate
  5. {
  6. /**
  7. * 验证规则
  8. */
  9. protected $rule = [
  10. 'idx' => 'require|number|between:0,100',
  11. 'price' => 'require|number|min:0',
  12. ];
  13. /**
  14. * 提示消息
  15. */
  16. protected $message = [
  17. 'idx.between' => '排单指数只能在0-100之间',
  18. 'price.min' => '不能小于0',
  19. ];
  20. /**
  21. * 验证场景
  22. */
  23. protected $scene = [
  24. 'add' => [],
  25. 'edit' => [],
  26. ];
  27. }