【BUG】修改最后一个库存不能秒杀的问题

This commit is contained in:
痴货 2024-09-14 19:50:27 +08:00
parent a81169ab8d
commit 7873f1400e

View File

@ -51,7 +51,7 @@ public interface SeckillActivityMapper extends BaseMapperX<SeckillActivityDO> {
Assert.isTrue(count > 0);
return update(null, new LambdaUpdateWrapper<SeckillActivityDO>()
.eq(SeckillActivityDO::getId, id)
.gt(SeckillActivityDO::getStock, count)
.ge(SeckillActivityDO::getStock, count)
.setSql("stock = stock - " + count));
}