diff --git a/server/product/internal/logic/getpricebypidlogic.go b/server/product/internal/logic/getpricebypidlogic.go index 6544c5c9..a14d196c 100644 --- a/server/product/internal/logic/getpricebypidlogic.go +++ b/server/product/internal/logic/getpricebypidlogic.go @@ -87,11 +87,17 @@ func (l *GetPriceByPidLogic) GetPriceByPid(req *types.GetPriceByPidReq, userinfo tmpPrice = float64(stepPriceSlice[numKey]) / 100 } num := int64(stepNum) * (*priceInfo.EachBoxNum) - rangeNum := fmt.Sprintf("%dPCS", num) - //不是最后一个 - if numKey < lenStepNum-1 { + rangeNum := "" + if numKey < lenStepNum-1 { //前面的 nextNum := int64(stepNumSlice[numKey+1]) * (*priceInfo.EachBoxNum) - rangeNum = fmt.Sprintf("%d-%dPCS", num, nextNum-1) + //第一个 + if numKey == 0 { + rangeNum = fmt.Sprintf("%d-%dPCS", num, nextNum-1) + } else { + rangeNum = fmt.Sprintf("%d-%dPCS", num, nextNum-1) + } + } else { //最后一个 + rangeNum = fmt.Sprintf(">=%dPCS", num) } stepListRsp = append(stepListRsp, types.StepPrice{ Range: rangeNum,