1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace app\api\validate;
- use think\Validate;
- class Withdraw extends Validate
- {
- protected $rule = [
- 'type' => 'require|in:wechat,alipay,bank',
- 'amount' => 'require|float|gt:0',
- 'account_id' => 'require|integer|gt:0',
- 'withdraw_sn' => 'require',
- 'status' => 'integer|in:-3,-2,-1,0,1,2',
- 'page' => 'integer|egt:1',
- 'page_size' => 'integer|between:1,100',
- ];
- protected $message = [
- 'type.require' => '请选择提现类型',
- 'type.in' => '请选择正确的提现类型',
- 'amount.require' => '请输入提现金额',
- 'amount.float' => '请输入正确的提现金额',
- 'amount.gt' => '请输入正确的提现金额',
- 'account_id.require' => '请选择提现账户',
- 'account_id.integer' => '账户ID必须为整数',
- 'account_id.gt' => '请选择正确的提现账户',
- 'withdraw_sn.require' => '未找到您的提现信息',
- 'status.integer' => '状态必须为整数',
- 'status.in' => '请选择正确的状态',
- 'page.integer' => '页码必须为整数',
- 'page.egt' => '页码必须大于等于1',
- 'page_size.integer' => '分页大小必须为整数',
- 'page_size.between' => '分页大小必须在1-100之间',
- ];
- protected $scene = [
- 'index' => ['status', 'page', 'page_size'],
- 'apply' => ['type', 'amount', 'account_id'],
- 'transfer' => ['type', 'withdraw_sn'],
- 'retry' => ['type', 'withdraw_sn'],
- 'cancel' => ['type', 'withdraw_sn'],
- ];
- }
|