From eaf5f86a1908311abf526cdbc46b1231306b9455 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 25 Oct 2023 18:30:52 +0800 Subject: [PATCH] fix --- service/repositories/shopping_cart.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/repositories/shopping_cart.go b/service/repositories/shopping_cart.go index 005cd527..106ac9d3 100644 --- a/service/repositories/shopping_cart.go +++ b/service/repositories/shopping_cart.go @@ -136,9 +136,9 @@ func (d *defaultShoppingCart) CaculateStepPrice(purchaseQuantity int64, stepPric //遍历查询合适的价格 for k, v := range stepPrice.PriceRange { //购买数量>起点 - if purchaseQuantity > v.StartQuantity { - //最后一个 || 小于等于终点 - if k == l-1 || (purchaseQuantity < v.EndQuantity && purchaseQuantity >= v.StartQuantity) { + if purchaseQuantity >= v.StartQuantity { + //最后一个 || 小于终点 + if k == l-1 || purchaseQuantity < v.EndQuantity { itemPrice = v.Price + fittingPrice return itemPrice * purchaseQuantity, itemPrice, nil }