setWithdrawModel(); } /** * 提现记录详情 接口 * @return string * @throws \Throwable */ public function index() { return view('finance.withdraw.withdraw-info', [ 'item' => $this->withdrawModel, 'set' => Setting::get('plugin.commission'), ])->render(); } /** * 附值 withdrawModel * @throws ShopException */ protected function setWithdrawModel() { $this->withdrawModel = Withdraw::find($this->getPostWithdrawId()); if (!$this->withdrawModel) { throw new ShopException('数据不存在或已被删除!'); } } /** * 获取 POST 提交的ID主键 * @return string * @throws ShopException */ protected function getPostWithdrawId() { $withdraw_id = trim(\YunShop::request()->id); if (empty($withdraw_id)) { throw new ShopException('数据错误,请重试!'); } return $withdraw_id; } }