can('dcat.admin.orders.remark'); } /** * Handle the form request. * * @param array $input * * @return mixed */ public function handle(array $input) { $orderId = $this->payload['id'] ?? 0; $order = Order::findOrFail($orderId); $remark = $input['remark']??''; $orderService = new OrderService(); try { DB::beginTransaction(); $orderService->adminRemark($order, $remark); DB::commit(); } catch (Throwable $th) { DB::rollBack(); report($th); throw new BizException('操作失败:'.$th->getMessage()); } return $this->response() ->success(__('admin.update_succeeded')) ->refresh(); } /** * Build a form here. */ public function form() { $orderId = $this->payload['id'] ?? 0; $order = Order::findOrFail($orderId); $this->text('remark')->required()->value($order->remark); $this->disableResetButton(); } }