MerchantFinancialAccountValidate.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\validate\merchant;
  12. use think\Validate;
  13. class MerchantFinancialAccountValidate extends Validate
  14. {
  15. protected $failException = true;
  16. /*
  17. {
  18. "financial_type":2,
  19. "name":"王二小",
  20. "idcard":"",
  21. "wechat":"1",
  22. "wechat_code":"456461516"
  23. }
  24. {
  25. "financial_type":3,
  26. "name":"王二小",
  27. "idcard":"",
  28. "alipay":"1",
  29. "alipay_code":"456461516"
  30. }
  31. */
  32. protected $rule = [
  33. 'financial_type|转账类型' => 'require|in:1,2,3',
  34. 'name|姓名' => 'require|chs',
  35. 'bank|开户银行' => 'requireIf:financial_type,1',
  36. 'bank_code|银行卡号' => 'requireIf:financial_type,1',
  37. //'idcard|身份证号' => 'requireIf:financial_type,2,3|idCard',
  38. 'wechat|微信号' => 'requireIf:financial_type,2',
  39. 'wechat_code|微信收款二维码' => 'requireIf:financial_type,2',
  40. 'alipay|支付宝账号' => 'requireIf:financial_type,3',
  41. 'alipay_code|收款二维码' => 'requireIf:financial_type,3',
  42. ];
  43. }