repository = $repository; } /** * 线下充值列表 * @return mixed * @author php迷途小书童 * @created 2021/2/3 13:38 */ public function lst() { [$page, $limit] = $this->getPage(); $where = $this->request->params(['keyword', 'date']); return app('json')->success($this->repository->getList($where, $page, $limit)); } /** * 发起退款 * @return mixed * @author php迷途小书童 * @created 2021/2/3 13:38 */ public function refund($id) { $detail = $this->repository->getOneById($id); if (!$detail) return app('json')->fail('数据不存在'); try { $haikeRepository = app()->make(MerchantHaikeApplyRepository::class); $return = $haikeRepository->haikeRefundApply(['recharge_id' => $id]); if ($return['return_code'] != 200) { return app('json')->fail($return['return_msg']); } } catch (\Throwable $e) { return app('json')->fail($e->getMessage()); } return app('json')->success('发起申请成功'); } /** * 线下充值详情 * @return mixed * @author php迷途小书童 * @created 2021/2/3 13:37 */ public function detail($id){ $detail = $this->repository->getOne($id); if (!$detail) return app('json')->fail('数据不存在'); return app("json")->success("获取成功", $detail); } }