can('dcat.admin.dealer_orders.remark'); } /** * Handle the form request. * * @param array $input * * @return mixed */ public function handle(array $input) { $orderId = $this->payload['id'] ?? 0; $order = DealerOrder::findOrFail($orderId); $remark = $input['remark']??''; // try { // DB::beginTransaction(); $order->update([ 'remark'=> $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 = DealerOrder::findOrFail($orderId); $this->text('remark')->required()->value($order->remark); $this->disableResetButton(); } }