Commit ed01d0ca by 杨树贤

精度

parent 6ed822cf
Showing with 3 additions and 4 deletions
......@@ -360,14 +360,14 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
}
//fmt.Println(costMapIndex)
priceRatio := priceRatioList[costMapIndex]
fmt.Println("获取到的阶梯系数为 : ", priceRatio)
priceCnRatio := priceRatio.Ratio
priceUsRatio := priceRatio.RatioUsd
// 阶梯价格系数正序取
fmt.Println("价格:",c.MulFloat(ladder.PriceCn, priceCnRatio))
generatedLadderPrice = append(generatedLadderPrice, model.LadderPrice{
Purchases: ladder.Purchases,
PriceCn: c.MyRound(c.MulFloat(ladder.PriceCn, priceCnRatio), 4),
PriceUs: c.MyRound(c.MulFloat(ladder.PriceUs, priceUsRatio), 4),
PriceCn: c.MyRound(c.MulFloat(ladder.PriceCn, priceCnRatio), 5),
PriceUs: c.MyRound(c.MulFloat(ladder.PriceUs, priceUsRatio), 5),
})
showPriceRatioList = append(showPriceRatioList, model.PriceRatio{
Ratio: priceCnRatio,
......@@ -375,7 +375,6 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
Purchases: int64(ladder.Purchases),
})
}
} else {
//价格阶梯数量超过最利润点的层级的情况
for i := 0; i < 9; i++ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment