Commit bcdd29f4 by mushishixian

售价系数判断问题

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