checkRefundOrder(); $this->rollBackStockFlag = $this->orderInfo->cycle_id == $this->initTodayCycleId(); Db::transaction(function (){ $this->manageRefundOrder(); $this->manageOrderByRefund(); $this->manageSubCateringLog(); }); $this->eventDispatcher->dispatch(new RefundGoodOrderFinishEvent($this->orderInfo->id, $this->payInfo->id, $this->refundInfo->id)); } /** * @return void * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ private function rollBackStock(): void { if (!$this->rollBackStockFlag) return; //判断是不是用户行为才退库存 if ($this->refundInfo->action_admin_id != 0) return; $this->sendStockMq($this->orderInfo->id,$this->orderInfo->status); } }