| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\api\validate;
- use think\Validate;
- class Market extends Validate
- {
- /**
- * 验证规则
- */
- protected $rule = [
- 'market_id' => 'require',
- 'product_id' => 'require',
- 'transfer_id' => 'require',
- 'min_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有误',
- 'min_price' => '价格有误',
- 'stock' => '数量有误',
- 'buying_id' => '参数有误',
- 'order_id' => '参数有误',
- 'phone.mobile' => '手机号有误',
- 'address.require' => '请填写地址',
- ];
-
- /**
- * 验证场景
- */
- protected $scene = [
- 'collect' => ['market_id'],
- 'announcement' => ['product_id'],
- 'transferlock' => ['transfer_id'],
- 'buying' => ['product_id', 'min_price', 'stock'],
- 'buying_info' => ['buying_id'],
- 'sellbuying' => ['buying_id', 'order_id'],
- 'cancelbuying' => ['buying_id'],
- ];
-
- }
|