| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace Modules\AgentApi\Responses;
- use Illuminate\Contracts\Support\Responsable;
- class WithdrawLogResponse implements Responsable
- {
- /**
- * 录入的数据.
- *
- * @var mixed
- */
- private $data = null;
- /**
- * 账号信息
- *
- * @var array|mixed
- */
- private $accountInfo = [];
- /**
- * 公告信息
- *
- * @var array
- */
- protected $annData = [];
- public function __construct($data = null, $accountInfo = [], $annData = [])
- {
- $this->data = $data;
- $this->accountInfo = $accountInfo;
- $this->annData = $annData;
- }
- public function toResponse($request)
- {
- $result = $this->data->toArray();
- //账户余额
- $result['account_info']['balance'] = $this->accountInfo['balance'] + $this->accountInfo['frozen'];
- //可提现金额
- $result['account_info']['withdraw_balance'] = $this->accountInfo['balance'];
- //公告信息
- $result['announce'] = $this->annData;
- return json_success($result);
- }
- }
|