From 87d3985a60ae92f688e5f202334fd25c46d493bd Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 25 Oct 2023 18:28:45 +0800 Subject: [PATCH] fix --- service/repositories/shopping_cart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/repositories/shopping_cart.go b/service/repositories/shopping_cart.go index 52b38248..005cd527 100644 --- a/service/repositories/shopping_cart.go +++ b/service/repositories/shopping_cart.go @@ -138,7 +138,7 @@ func (d *defaultShoppingCart) CaculateStepPrice(purchaseQuantity int64, stepPric //购买数量>起点 if purchaseQuantity > v.StartQuantity { //最后一个 || 小于等于终点 - if k == l-1 || purchaseQuantity < v.EndQuantity { + if k == l-1 || (purchaseQuantity < v.EndQuantity && purchaseQuantity >= v.StartQuantity) { itemPrice = v.Price + fittingPrice return itemPrice * purchaseQuantity, itemPrice, nil }