Commit 6209d9c3 by 杨树贤

修复

parent 653c7074
......@@ -26,13 +26,13 @@ func (sc *CustomPrice) getCustomPriceList(sku model.LySku) (customPriceList []mo
var customPrice model.CustomPrice
customPrice.PriceName = priceName
for _, item := range sku.LadderPrice {
ratioFloat := c.DivFloat(float64(100 + ratio) , 100)
ratioFloat := c.DivFloat(float64(100+ratio), 100)
customPrice.LadderPrice = append(customPrice.LadderPrice, model.LadderPrice{
Purchases: item.Purchases,
PriceCn: c.MyRound(c.MulFloat(item.PriceCn * ratioFloat),2),
PriceUs: c.MyRound(c.MulFloat(item.PriceUs * ratioFloat),2),
PriceAc: c.MyRound(c.MulFloat(item.PriceAc * ratioFloat),2),
PriceAcUs: c.MyRound(c.MulFloat(item.PriceAcUs * ratioFloat),2),
PriceCn: c.MyRound(c.MulFloat(item.PriceCn*ratioFloat), 2),
PriceUs: c.MyRound(c.MulFloat(item.PriceUs*ratioFloat), 2),
PriceAc: c.MyRound(c.MulFloat(item.PriceAc*ratioFloat), 2),
PriceAcUs: c.MyRound(c.MulFloat(item.PriceAcUs*ratioFloat), 2),
})
}
customPriceList = append(customPriceList, customPrice)
......@@ -59,11 +59,12 @@ func (sc *CustomPrice) transformIEdgeLadderPrice(sku model.LySku) (ladderPriceLi
]
*/
if len(sku.CustomPriceList) != 0 {
for _, customPrice := range sku.CustomPriceList {
if len(customPrice.LadderPrice)>0 {
//只取一个元素价格就行
ladderPrice := customPrice.LadderPrice[0]
for index, customPrice := range sku.CustomPriceList {
if len(customPrice.LadderPrice) > 0 {
//只取最后一个元素价格就行
ladderPrice := customPrice.LadderPrice[len(customPrice.LadderPrice)-1]
ladderPrice.PriceName = customPrice.PriceName
ladderPrice.Purchases = int64(index + 1)
ladderPriceList = append(ladderPriceList, ladderPrice)
}
......
......@@ -293,13 +293,11 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//sku.Original = nil
return sku
}
priceService := PriceService{}
flag := 0
var data []model.LadderPrice
var originalPrice []model.OriginPrice
sort.Sort(sorter.OriginPriceSorter(sku.OriginalPrice))
//专卖价格获取
if sku.SupplierId == 17 {
ladderPrice := sku.LadderPrice
......@@ -313,7 +311,6 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
ladderPrice = sku.LadderPrice
}
}
//获取折扣系数
sku = priceService.GetDiscountRatio(sku)
data = make([]model.LadderPrice, len(ladderPrice))
......
......@@ -81,7 +81,6 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) model.LySku {
priceRatio.Purchases = gjson.Get(value.String(), "purchases").Int()
priceRatioList = append(priceRatioList, priceRatio)
}
//是否满足特定条件的判断
var hasSpecialCheck = false
//判断是否有符合的商品名称
......
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