DepositAddressValidate.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\admin\validate;
  3. class DepositAddressValidate extends BaseValidate
  4. {
  5. /**
  6. * 设置校验规则
  7. * @var string[]
  8. */
  9. protected $rule = [
  10. 'currency' => 'require',
  11. 'network_type' => 'require',
  12. 'address' => 'require',
  13. 'security_code' => 'nullable',
  14. 'withdraw_fee' => 'nullable|numeric|min:0|max:0.99|regex:/^\d+(\.\d{1,2})?$/',
  15. 'is_withdraw' => 'require|integer|in:1,0',
  16. ];
  17. /**
  18. * 参数描述
  19. * @var string[]
  20. */
  21. protected $field = [
  22. 'currency' => '币种',
  23. 'network_type' => '网络类型',
  24. 'address' => '地址',
  25. 'security_code' => '安全码',
  26. 'withdraw_fee' => '提现手续费',
  27. 'is_withdraw' => '是否开启提现',
  28. ];
  29. /**
  30. * @notes 编辑场景
  31. */
  32. public function sceneEdit()
  33. {
  34. return $this->only(['id','currency', 'network_type', 'address', 'security_code', 'withdraw_fee', 'is_withdraw']);
  35. }
  36. public function sceneId()
  37. {
  38. return $this->only(['id']);
  39. }
  40. }