Преглед на файлове

添加查询所有直播间接口

yuhongqi преди 2 дни
родител
ревизия
66e43970fa

+ 1 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java

@@ -144,6 +144,6 @@ public interface LiveMapper
 
     List<Live> selectLiveShowReadyStartLiveList(@Param("companyIds") List<Long> companyIds);
 
-    @Select("select * from live where is_audit = 1 and id_del = 0 and status in (1,2,4) and live_type in (2,3) order by create_time desc")
+    @Select("select * from live where is_audit = 1 and is_del = 0 and status in (1,2,4) and live_type in (2,3) order by create_time desc")
     List<Live> liveListAll();
 }

+ 2 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -3194,6 +3194,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         if(goods == null) return R.error("当前商品不存在");
         if(fsStoreProduct == null) return R.error("店铺已下架商品,购买失败");
         if(fsStoreProduct.getIsShow() == 0 || goods.getStatus() == 0) return R.error("商品已下架,购买失败");
+        if(liveOrder.getTotalNum() == null || StringUtils.isEmpty(liveOrder.getTotalNum())) liveOrder.setTotalNum("1");
+        if(goods.getStock() == null) return R.error("直播间商品库存不足");
         if(fsStoreProduct.getStock() < Integer.parseInt(liveOrder.getTotalNum()) || goods.getStock() < Integer.parseInt(liveOrder.getTotalNum())) return R.error("抱歉,这款商品已被抢光,暂时无库存~");
 
         // 更改店铺库存