row->id; DB::beginTransaction(); try { //退还余额 $res = Order::orderCancel($id); DB::commit(); } catch ( \Exception $e){ dd($e->getMessage()); DB::rollBack(); return $this->response()->error('操作失败!'); } if($res){ return $this->response()->success('操作成功!')->refresh(); } return $this->response()->error('操作失败!'); } }