12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace app\api\validate\user;
- use think\Validate;
- class Account extends Validate
- {
- protected $rule = [
- 'type' => 'require|in:wechat,alipay,bank',
- 'account_name' => 'require',
- 'account_header' => 'require',
- 'account_no' => 'requireIf:type,alipay|requireIf:type,bank'
- ];
- protected $message = [
- 'type.require' => '请选择账户类型',
- 'type.in' => '请选择正确的账户类型',
- 'account_name.require' => '请填写姓名',
- 'account_header.require' => '请填写开户行',
- 'account_no.requireIf' => '请填写账号信息',
- ];
- protected $scene = [
- 'index' => ['type'],
- 'wechat' => ['type', 'account_name'],
- 'alipay' => ['type', 'account_name', 'account_no'],
- 'bank' => ['type', 'account_name', 'account_header', 'account_no']
- ];
- }
|