post(); $pageSize = request()->post('pageSize', 15); $params['user_id'] = isset($params['user_id']) ? $params['user_id'] : $this->userId; $datas = AccountService::make()->getDataList($params, $pageSize); if ($datas) { return message(1010, true, $datas); } else { return message(1009, false); } } /** * 明细 * @return array */ public function info() { $id = request()->post('id', 0); $info = AccountService::make()->getInfo($id); if ($info) { return showJson(1010, true, $info); } else { return showJson(1004, false); } } /** * 余额明细 * @return array */ public function balance() { $params = request()->post(); $pageSize = request()->post('pageSize', 15); $params['user_id'] = isset($params['user_id']) ? $params['user_id'] : $this->userId; $datas = BalanceLogService::make()->getDataList($params, $pageSize); return message(1010, true, $datas); } /** * 收入提现 * @return array */ public function withdraw() { try { $params = request()->all(); if (!$result = BalanceLogService::make()->withdraw($this->userId, $params)) { return showJson(BalanceLogService::make()->getError(), false); } else { return showJson(BalanceLogService::make()->getError(), true, $result); } } catch (\Exception $exception) { $error = ['data' => $exception->getTrace(), 'err' => $exception->getMessage()]; return showJson(1046, false, $error); } } }