Skip to content

Commit

Permalink
修改 前置、后置出来逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
liufei-ereach committed Jun 30, 2024
1 parent 77cf8c9 commit cb8f4be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/BuyGoodsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ protected function data(ServerRequestInterface $request, Document $document) {
$after = StoreExtend::getAfter($store->code);
if ($after) {
// 商品处理失败,通知购买失败事件进行回滚操作
if (!$after->after($actor, $store, $params)) {
$this->events->dispatch(new StoreBuyFailEvent($user, $store, $cart, $params, $this->translator, $this->settings, $this->events, $this->cache));
if (!$after->after($actor, $store, $params, $this->translator, $this->settings, $this->events, $this->cache)) {
$this->events->dispatch(new StoreBuyFailEvent($user, $store, $cart, $params));
throw new ValidationException(['message' => $this->translator->trans('mattoid-store.forum.error.buy-goods-fail', ['title' => $store->title])]);
}
}
Expand Down

0 comments on commit cb8f4be

Please sign in to comment.