WalletValidate.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. namespace app\admin\validate;
  3. class WalletValidate extends BaseValidate
  4. {
  5. /**
  6. * 设置校验规则
  7. * @var string[]
  8. */
  9. protected $rule = [
  10. 'id' => 'require',
  11. 'safe_word' => 'require',
  12. 'operation_remark' => 'require|length:0,200',
  13. 'address' => 'require|length:0,128',
  14. 'user_id' => 'require',
  15. 'amount' => 'require|float|min:0.01',
  16. 'type' => 'require|in:recharge,withdraw',
  17. 'payment_password' => 'require',
  18. ];
  19. /**
  20. * 参数描述
  21. * @var string[]
  22. */
  23. protected $field = [
  24. 'id' => 'id',
  25. 'safe_word' => '资金密码',
  26. 'operation_remark' => '驳回原因',
  27. 'address' => '提现地址',
  28. 'user_id' => '用户ID',
  29. 'amount' => '金额',
  30. 'type' => '操作类型',
  31. 'payment_password' => '资金密码',
  32. ];
  33. /**
  34. * @notes 充值审核通过
  35. */
  36. public function sceneRechargePass()
  37. {
  38. return $this->only(['safe_word', 'id']);
  39. }
  40. public function sceneRechargeRefuse()
  41. {
  42. return $this->only(['id', 'operation_remark']);
  43. }
  44. /**
  45. * @notes 提现审核通过
  46. */
  47. public function sceneWithdrawPass()
  48. {
  49. return $this->only(['safe_word', 'id']);
  50. }
  51. public function sceneWithdrawRefuse()
  52. {
  53. return $this->only(['id', 'operation_remark']);
  54. }
  55. public function sceneUpdateAddress()
  56. {
  57. return $this->only(['id', 'safe_word', 'address']);
  58. }
  59. public function sceneChangeMoney()
  60. {
  61. return $this->only(['user_id', 'amount', 'type','payment_password']);
  62. }
  63. }