Withdraw.php 1.4 KB

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