appendHtmlAttribute('class', $class); $this->defaultHtmlAttribute('href', 'javascript:;'); return "formatHtmlAttributes()}>{$this->title}"; } public function handle(Request $request) { $id = $this->getKey(); try { $order = Order::whereIn('status', [OrderStatus::PAID, OrderStatus::PAID_RETAINAGE, OrderStatus::OFFLINE_PAID, OrderStatus::REFUSED_REFUND]) ->find($id); if (!$order) { throw new \Exception('订单不存在或已经核销过了'); } $order->status = OrderStatus::SUCCESS; if ($order->save()) { //分账 //线下订单不分账 if ($order->pay_type != PayType::OFFLINE) { (new VerificationController)->fund($order); } } return $this->response()->success('操作成功')->refresh(); } catch (\Exception $e) { return $this->response()->error($e->getMessage())->refresh(); } } public function confirm() { return ['确定要核销该订单吗?', '']; } }