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