| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace Modules\ManageApi\Responses;
- use Illuminate\Contracts\Support\Responsable;
- class FinanceWithdrawResponse implements Responsable
- {
- /**
- * 录入的数据.
- *
- * @var mixed
- */
- private $data = null;
- /**
- * 提现统计数据
- *
- * @var array|mixed
- */
- private $recTotal = [];
- public function __construct($data = null, $witTotal = [])
- {
- $this->data = $data;
- $this->witTotal = $witTotal;
- }
- public function toResponse(
- $request = null
- ) {
- if (!$this->data->isEmpty()) {
- foreach ($this->data as &$v) {
- $v->agent_name = $v->agent->username ?? '';
- $v->commission_ratio = $v->agent->commission_ratio ?? '';
- unset($v->agent);
- }
- }
- $result = $this->data->toArray();
- $result['wit_total'] = $this->recTotal;
- return json_success($result);
- }
- }
|