Commit 56b1b965 by hcy

限制库存不能大于现有库存

parent 33e24e67
Showing with 2 additions and 0 deletions
......@@ -342,9 +342,11 @@ func (ls *LyService) LyGoodsDetail(ctx context.Context, params RequestParams, go
//获取新的限制库存信息
has, limitStock := ls.getLimitStock(sku.GoodsId)
if has {
if int64(limitStock) < sku.Stock {
sku.Stock = int64(limitStock)
sku.BatchSn = "" //如果存在指定库存,则批次是空
}
}
sku = ls.GetStock(sku)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment