MerchantFinancialAccountValidate.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\validate\merchant;
  3. use think\Validate;
  4. class MerchantFinancialAccountValidate extends Validate
  5. {
  6. protected $failException = true;
  7. /*
  8. {
  9. "financial_type":2,
  10. "name":"王二小",
  11. "idcard":"",
  12. "wechat":"1",
  13. "wechat_code":"456461516"
  14. }
  15. {
  16. "financial_type":3,
  17. "name":"王二小",
  18. "idcard":"",
  19. "alipay":"1",
  20. "alipay_code":"456461516"
  21. }
  22. */
  23. protected $rule = [
  24. 'financial_type|转账类型' => 'require|in:1,2,3',
  25. 'name|姓名' => 'require|chs',
  26. 'bank|开户银行' => 'requireIf:financial_type,1',
  27. 'bank_code|银行卡号' => 'requireIf:financial_type,1',
  28. //'idcard|身份证号' => 'requireIf:financial_type,2,3|idCard',
  29. 'wechat|微信号' => 'requireIf:financial_type,2',
  30. 'wechat_code|微信收款二维码' => 'requireIf:financial_type,2',
  31. 'alipay|支付宝账号' => 'requireIf:financial_type,3',
  32. 'alipay_code|收款二维码' => 'requireIf:financial_type,3',
  33. ];
  34. }