| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\api\validate;
- use think\Validate;
- class Teac extends Validate
- {
- /**
- * 验证规则
- */
- protected $rule = [
- 'market_id' => 'require',
- 'product_id' => 'require',
- 'transfer_id' => 'require',
- 'price' => 'require|number|gt:0',
- 'stock' => 'require|number|gt:0',
- 'buying_id' => 'require|number|gt:0',
- 'order_id' => 'require|number',
- 'address' => 'require',
- 'price' => 'require|number|gt:0',
- ];
-
- /**
- * 提示消息
- */
- protected $message = [
- 'market_id.require' => '订单ID有误',
- 'product_id.require' => '产品ID有误', //
- 'transfer_id.require' => '参数ID有误',
- 'price' => '价格有误',
- 'stock' => '数量有误',
- 'buying_id' => '参数有误',
- 'order_id' => '参数有误',
- 'phone.mobile' => '手机号有误',
- 'address.require' => '请填写地址',
- ];
-
- /**
- * 验证场景
- */
- protected $scene = [
-
- 'buying' => ['price', 'stock'],
- 'sell' => ['price', 'stock'],
- 'sellbuying' => ['buying_id', 'order_id'],
- 'cancelbuying' => ['buying_id'],
- ];
-
- }
|