This commit is contained in:
laodaming 2023-10-25 18:25:54 +08:00
parent 425e53e445
commit bd8615e9f2

View File

@ -138,7 +138,7 @@ func (d *defaultShoppingCart) CaculateStepPrice(purchaseQuantity int64, stepPric
//购买数量>起点 //购买数量>起点
if purchaseQuantity > v.StartQuantity { if purchaseQuantity > v.StartQuantity {
//最后一个 || 小于等于终点 //最后一个 || 小于等于终点
if k == l-1 || purchaseQuantity <= v.EndQuantity { if k == l-1 || purchaseQuantity < v.EndQuantity {
itemPrice = v.Price + fittingPrice itemPrice = v.Price + fittingPrice
return itemPrice * purchaseQuantity, itemPrice, nil return itemPrice * purchaseQuantity, itemPrice, nil
} }