From 104a9db7eadc42394f3028e9f0b86f928af5156d Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Thu, 10 Aug 2023 10:19:37 +0800 Subject: [PATCH] fix --- server/product/internal/logic/getpricebypidlogic.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/product/internal/logic/getpricebypidlogic.go b/server/product/internal/logic/getpricebypidlogic.go index 44bfe67a..ea18202f 100644 --- a/server/product/internal/logic/getpricebypidlogic.go +++ b/server/product/internal/logic/getpricebypidlogic.go @@ -116,7 +116,12 @@ func (l *GetPriceByPidLogic) dealWithStepRange(stepNumSlice, stepPriceSlice []in end := int64(0) if numKey == 0 { //第一个 begin = *priceInfo.MinBuyNum * (*priceInfo.EachBoxNum) - end = num - 1 + //只有一阶价格 + if lenStepPrice == 1 { + end = -1 + } else { + end = num - 1 + } } else if numKey < lenStepNum-1 { //中间的 nextNum := int64(stepNumSlice[numKey+1]) * (*priceInfo.EachBoxNum) begin = num