Withdraw.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. 'status' => 'integer|in:-3,-2,-1,0,1,2',
  12. 'page' => 'integer|egt:1',
  13. 'page_size' => 'integer|between:1,100',
  14. ];
  15. protected $message = [
  16. 'type.require' => '请选择提现类型',
  17. 'type.in' => '请选择正确的提现类型',
  18. 'amount.require' => '请输入提现金额',
  19. 'amount.float' => '请输入正确的提现金额',
  20. 'amount.gt' => '请输入正确的提现金额',
  21. 'account_id.require' => '请选择提现账户',
  22. 'account_id.integer' => '账户ID必须为整数',
  23. 'account_id.gt' => '请选择正确的提现账户',
  24. 'withdraw_sn.require' => '未找到您的提现信息',
  25. 'status.integer' => '状态必须为整数',
  26. 'status.in' => '请选择正确的状态',
  27. 'page.integer' => '页码必须为整数',
  28. 'page.egt' => '页码必须大于等于1',
  29. 'page_size.integer' => '分页大小必须为整数',
  30. 'page_size.between' => '分页大小必须在1-100之间',
  31. ];
  32. protected $scene = [
  33. 'index' => ['status', 'page', 'page_size'],
  34. 'apply' => ['type', 'amount', 'account_id'],
  35. 'transfer' => ['type', 'withdraw_sn'],
  36. 'retry' => ['type', 'withdraw_sn'],
  37. 'cancel' => ['type', 'withdraw_sn'],
  38. ];
  39. }