Kaynağa Gözat

更新直播商品

yuhongqi 2 hafta önce
ebeveyn
işleme
86ebd61733

+ 2 - 2
fs-service-system/src/main/java/com/fs/live/service/impl/LiveGoodsServiceImpl.java

@@ -96,8 +96,8 @@ public class LiveGoodsServiceImpl  implements ILiveGoodsService {
         liveGoods.setUpdateTime(DateUtils.getNowDate());
         LiveGoods existGoods = baseMapper.selectLiveGoodsByGoodsId(liveGoods.getGoodsId());
         if (liveGoods.getStock() != null) {
-            if(liveGoods.getProductId() == null) return R.error("店铺已停止售卖商品!");
-            FsStoreProduct fsStoreProduct = fsStoreProductMapper.selectFsStoreProductById(liveGoods.getProductId());
+            if(existGoods.getProductId() == null) return R.error("店铺已停止售卖商品!");
+            FsStoreProduct fsStoreProduct = fsStoreProductMapper.selectFsStoreProductById(existGoods.getProductId());
             if(fsStoreProduct == null) return R.error("商品不存在");
             if(fsStoreProduct.getIsShow() == 0 || existGoods.getStatus() == 0) return R.error("商品已下架");
             if(fsStoreProduct.getStock() < liveGoods.getStock()) return R.error("商品库存不足");