UserReceiptValidate.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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\api;
  12. use think\Validate;
  13. class UserReceiptValidate extends Validate
  14. {
  15. protected $failException = true;
  16. protected $rule = [
  17. 'receipt_type|发票类型' => 'require|in:1,2',
  18. 'receipt_title|发票抬头' => 'require',
  19. 'receipt_title_type|发票抬头类型' => 'require|in:1,2',
  20. 'duty_paragraph|税号' => 'requireIf:receipt_title_type,2|alphaNum',
  21. 'email|邮箱' => 'requireIf:receipt_type,1|email',
  22. 'bank_name|开户行' => 'requireIf:receipt_type,2',
  23. 'bank_code|银行卡号' => 'requireIf:receipt_type,2|number',
  24. 'address|企业地址' => 'requireIf:receipt_type,2',
  25. 'tel|企业电话' => 'requireIf:receipt_type,2',
  26. ];
  27. }