Withdraw.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\api\validate;
  3. use think\Validate;
  4. class Withdraw extends Validate
  5. {
  6. protected $rule = [
  7. 'type' => 'require',
  8. 'money' => 'require|float|gt:0',
  9. 'account_name' => 'require',
  10. 'account_no' => 'requireIfAll:type,alipay,bank',
  11. 'account_header' => 'requireIf:type,bank',
  12. 'withdraw_sn' => 'require',
  13. 'page' => 'integer|egt:1',
  14. 'page_size' => 'integer|between:1,100',
  15. ];
  16. protected $message = [
  17. 'type.require' => '请选择提现类型',
  18. 'money.require' => '请输入提现金额',
  19. 'money.float' => '请输入正确的提现金额',
  20. 'money.gt' => '请输入正确的提现金额',
  21. 'account_name.require' => '请填写真实姓名',
  22. 'account_no.requireIfAll' => '请填写账号信息',
  23. 'account_header.requireIf' => '请填写开户行',
  24. 'withdraw_sn.require' => '未找到您的提现信息',
  25. 'page.integer' => '页码必须为整数',
  26. 'page.egt' => '页码必须大于等于1',
  27. 'page_size.integer' => '分页大小必须为整数',
  28. 'page_size.between' => '分页大小必须在1-100之间',
  29. ];
  30. protected $scene = [
  31. 'index' => ['page', 'page_size'],
  32. 'apply' => ['type', 'money', 'account_name', 'account_no', 'account_header'],
  33. 'transfer' => ['type', 'withdraw_sn'],
  34. 'retry' => ['type', 'withdraw_sn'],
  35. 'cancel' => ['type', 'withdraw_sn'],
  36. ];
  37. }