fix
This commit is contained in:
@@ -108,21 +108,24 @@ func (l *GetPriceByPidLogic) dealWithStepRange(stepNumSlice, stepPriceSlice []in
|
||||
tmpPrice = float64(stepPriceSlice[numKey]) / 100
|
||||
}
|
||||
num := int64(stepNum) * (*priceInfo.EachBoxNum)
|
||||
rangeNum := ""
|
||||
if numKey < lenStepNum-1 { //前面的
|
||||
nextNum := int64(stepNumSlice[numKey+1]) * (*priceInfo.EachBoxNum)
|
||||
//第一个
|
||||
if numKey == 0 {
|
||||
rangeNum = fmt.Sprintf("%d-%dPCS", num, nextNum-1)
|
||||
} else {
|
||||
rangeNum = fmt.Sprintf("%d-%dPCS", num, nextNum-1)
|
||||
rangeNum := types.RangeNum{}
|
||||
//只有1个
|
||||
if lenStepNum == 1 {
|
||||
rangeNum.Begin = num
|
||||
rangeNum.End = 99999999999
|
||||
} else {
|
||||
if numKey < lenStepNum-1 { //前面的
|
||||
nextNum := int64(stepNumSlice[numKey+1]) * (*priceInfo.EachBoxNum)
|
||||
rangeNum.Begin = num
|
||||
rangeNum.End = nextNum - 1
|
||||
} else { //最后一个
|
||||
rangeNum.Begin = num
|
||||
rangeNum.End = 99999999999
|
||||
}
|
||||
} else { //最后一个
|
||||
rangeNum = fmt.Sprintf(">=%dPCS", num)
|
||||
}
|
||||
stepListRsp = append(stepListRsp, types.StepPrice{
|
||||
Range: rangeNum,
|
||||
Price: tmpPrice,
|
||||
RangeNum: rangeNum,
|
||||
Price: tmpPrice,
|
||||
})
|
||||
}
|
||||
return stepListRsp
|
||||
|
||||
Reference in New Issue
Block a user