WithdrawLogResponse.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Modules\AgentApi\Responses;
  3. use Illuminate\Contracts\Support\Responsable;
  4. class WithdrawLogResponse implements Responsable
  5. {
  6. /**
  7. * 录入的数据.
  8. *
  9. * @var mixed
  10. */
  11. private $data = null;
  12. /**
  13. * 账号信息
  14. *
  15. * @var array|mixed
  16. */
  17. private $accountInfo = [];
  18. /**
  19. * 公告信息
  20. *
  21. * @var array
  22. */
  23. protected $annData = [];
  24. public function __construct($data = null, $accountInfo = [], $annData = [])
  25. {
  26. $this->data = $data;
  27. $this->accountInfo = $accountInfo;
  28. $this->annData = $annData;
  29. }
  30. public function toResponse($request)
  31. {
  32. $result = $this->data->toArray();
  33. //账户余额
  34. $result['account_info']['balance'] = $this->accountInfo['balance'] + $this->accountInfo['frozen'];
  35. //可提现金额
  36. $result['account_info']['withdraw_balance'] = $this->accountInfo['balance'];
  37. //公告信息
  38. $result['announce'] = $this->annData;
  39. return json_success($result);
  40. }
  41. }