This commit is contained in:
laodaming
2023-09-27 15:12:18 +08:00
parent 2ac507ef34
commit 9e2526405f
2 changed files with 23 additions and 6 deletions

View File

@@ -108,14 +108,17 @@ func (l *GetProductStepPriceLogic) GetProductStepPrice(req *types.GetProductStep
for rIndex, rangeInfo := range stepPrice.PriceRange {
//最后一个
if rIndex+1 == rangeLen {
begin := format.NumToStringWithThousandthPercentile(fmt.Sprintf("%d", rangeInfo.StartQuantity))
stepRange = append(stepRange, map[string]interface{}{
"range_description": fmt.Sprintf(">=%s Units", format.NumToStringWithThousandthPercentile(rangeInfo.StartQuantity)),
"range_description": fmt.Sprintf(">=%s Units", begin),
"item_price": format.CentitoDollar(rangeInfo.Price, 3),
})
break
}
begin := format.NumToStringWithThousandthPercentile(fmt.Sprintf("%d", rangeInfo.StartQuantity))
end := format.NumToStringWithThousandthPercentile(fmt.Sprintf("%d", rangeInfo.EndQuantity))
stepRange = append(stepRange, map[string]interface{}{
"range_description": fmt.Sprintf("%s-%s Units", format.NumToStringWithThousandthPercentile(rangeInfo.StartQuantity), format.NumToStringWithThousandthPercentile(rangeInfo.EndQuantity)),
"range_description": fmt.Sprintf("%s-%s Units", begin, end),
"item_price": format.CentitoDollar(rangeInfo.Price, 3),
})
}