|
|
|
@ -217,17 +217,6 @@ class OrderOnlineService implements OrderOnlineServiceInterface |
|
|
|
'cover_img' => $goods->cover_img ?: '', |
|
|
|
'spec' => json_encode($goods->spec), |
|
|
|
]; |
|
|
|
|
|
|
|
// 拼接activity_type和goods_id
|
|
|
|
$inventoryKey = 'goods_inventory_sold_'.$cart->activity_type.'_'.$cart->goods_id; |
|
|
|
|
|
|
|
// 压redis库存
|
|
|
|
// redis记录当前商品的购买数量,压库存,下单失败、下单成功扣库存成功、订单取消的时候释放
|
|
|
|
if (!$redis->exists($inventoryKey)) { |
|
|
|
$redis->set($inventoryKey, $cart->num); |
|
|
|
} else { |
|
|
|
$redis->incrBy($inventoryKey, $cart->num); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 子订单数据
|
|
|
|
|