diff --git a/app/shop/logic/order/OrderLogic.php b/app/shop/logic/order/OrderLogic.php index 8f90ba38..ca142a9b 100755 --- a/app/shop/logic/order/OrderLogic.php +++ b/app/shop/logic/order/OrderLogic.php @@ -33,6 +33,7 @@ use app\common\logic\OrderLogLogic; use app\common\logic\OrderRefundLogic; use app\common\model\Delivery; use app\common\model\Express; +use app\common\model\groupbuy\GroupbuyGoods; use app\common\model\order\Order; use app\common\model\DevRegion; use app\common\model\order\OrderGoods; @@ -675,7 +676,10 @@ class OrderLogic extends Logic Db::startTrans(); try { $order = Order::where(['id' => $order_id], ['orderGoods'])->find(); - + if ($order['order_type'] == OrderEnum::GROUP_BUY) { + $order_goods = OrderGoods::where('order_id', $order['id'])->find(); + GroupbuyGoods::where(['item_id' => $order_goods['item_id']])->inc('stock', $order['total_num'])->update(); + } // 如果是拼团订单 if ($order['order_type'] == OrderEnum::TEAM_ORDER) { $time = time();