12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace app\admin\validate;
- use think\Validate;
- class Book extends Validate
- {
- /**
- * 验证规则
- */
- protected $rule = [
- 'idx' => 'require|number|between:0,100',
- 'price' => 'require|number|min:0',
- ];
- /**
- * 提示消息
- */
- protected $message = [
- 'idx.between' => '排单指数只能在0-100之间',
- 'price.min' => '不能小于0',
- ];
- /**
- * 验证场景
- */
- protected $scene = [
- 'add' => [],
- 'edit' => [],
- ];
-
- }
|