Commit bcdd29f4 by mushishixian

售价系数判断问题

parent 77e2a838
......@@ -162,7 +162,6 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
}
}
} else {
fmt.Println(activity)
//判断是否是搞活动的品牌
if as.CheckStandardBrand(checkData.StandardBrandId, activity) {
hasActivity = true
......
......@@ -333,21 +333,28 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
}
//判断是否有符合的商品名称
goodsNames := gjson.Get(priceRatioCache, "goods_name."+sortString).String()
if goodsNames != "" {
goodsNameList := strings.Split(goodsNames, "€")
//找到有对应的商品名称,那么优先级肯定是最高的了
if php2go.InArray(sku.GoodsName, goodsNameList) {
break
}
}
//判断是否有符合的标准品牌ID
brandIds := gjson.Get(priceRatioCache, "brand"+sortString).String()
if brandIds != "" {
standardBrandIdList := strings.Split(brandIds, "€")
standardBrandId := strconv.Itoa(sku.StandardBrand.StandardBrandId)
//找到有对应的品牌,那么优先级肯定是最高的了
if php2go.InArray(standardBrandId, standardBrandIdList) {
break
}
}
//判断是否有符合的eccn
eccns := gjson.Get(priceRatioCache, "eccn"+sortString).String()
if eccns != "" {
eccnList := strings.Split(eccns, "€")
//找到有对应的eccn,那么优先级肯定是最高的了
for _, eccn := range eccnList {
......@@ -355,12 +362,11 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
break
}
}
}
//如果没有设置品牌和商品,那么这个优先级高的就会覆盖下面的了,不需要再去判断品牌和型号了
if len(goodsNameList) == 0 && len(standardBrandIdList) == 0 && len(eccnList) == 0 {
break
}
}
}
sku.PriceRatio = priceRatioList
sku.PriceRatioSort = priceRatioSort
fmt.Println("售价组系数 : ", priceRatioList)
......
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