Commit 81cba3bb by mushishixian

修复价格问题

parent 84490a0b
Showing with 9 additions and 7 deletions
......@@ -230,8 +230,9 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//找一个标志位,因为默认的全局折扣系数的数据格式和非全局的是不一样的
isDefaultDiscoutRatio := false
discountRatio, _ := redis.String(redisCon.Do("HGET", "magic_cube_channel_discount_daigou", sku.SupplierId))
checkNullRation := gjson.Get(discountRatio, "ration").String()
//如果这个渠道没有对应的折扣系数,那么就去读取全局的
if discountRatio == "" {
if discountRatio == "" || checkNullRation == "" {
isDefaultDiscoutRatio = true
discountRatio, _ = redis.String(redisCon.Do("GET", "magic_cube_channel_discount_default_daigou"))
}
......@@ -262,7 +263,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
goodsNames := gjson.Get(discountRatio, "goods_name."+sortString).String()
if goodsNames != "" {
hasSpecialCheck = true
goodsNameList := strings.Split(goodsNames, "")
goodsNameList := strings.Split(goodsNames, "@€@")
//找到有对应的商品名称,那么优先级肯定是最高的了
if php2go.InArray(sku.GoodsName, goodsNameList) {
break
......@@ -273,7 +274,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
brandIds := gjson.Get(discountRatio, "brand."+sortString).String()
if brandIds != "" {
hasSpecialCheck = true
standardBrandIdList := strings.Split(brandIds, "")
standardBrandIdList := strings.Split(brandIds, "@€@")
standardBrandId := strconv.Itoa(sku.StandardBrand.StandardBrandId)
//找到有对应的品牌,那么优先级肯定是最高的了
if php2go.InArray(standardBrandId, standardBrandIdList) {
......@@ -296,8 +297,9 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//找一个标志位,因为默认的全局折扣系数的数据格式和非全局的是不一样的
isDefaultPriceRatio := false
priceRatioCache, _ := redis.String(redisCon.Do("HGET", "magic_cube_price_rule_channel", sku.SupplierId))
checkNullRation = gjson.Get(priceRatioCache, "ladder_price").String()
//如果这个渠道没有对应的折扣系数,那么就去读取全局的
if priceRatioCache == "" {
if priceRatioCache == "" || checkNullRation == "" {
isDefaultPriceRatio = true
priceRatioCache, _ = redis.String(redisCon.Do("GET", "magic_cube_price_rule_channel_default"))
}
......@@ -346,7 +348,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
goodsNames := gjson.Get(priceRatioCache, "goods_name."+sortString).String()
if goodsNames != "" {
hasSpecialCheck = true
goodsNameList := strings.Split(goodsNames, "")
goodsNameList := strings.Split(goodsNames, "@€@")
//找到有对应的商品名称,那么优先级肯定是最高的了
if php2go.InArray(sku.GoodsName, goodsNameList) {
break
......@@ -357,7 +359,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
brandIds := gjson.Get(priceRatioCache, "brand."+sortString).String()
if brandIds != "" {
hasSpecialCheck = true
standardBrandIdList := strings.Split(brandIds, "")
standardBrandIdList := strings.Split(brandIds, "@€@")
standardBrandId := strconv.Itoa(sku.StandardBrand.StandardBrandId)
//找到有对应的品牌,那么优先级肯定是最高的了
if php2go.InArray(standardBrandId, standardBrandIdList) {
......@@ -368,7 +370,7 @@ func (ls *LyService) GetCoefficientAndPrice(sku model.LySku) model.LySku {
//判断是否有符合的eccn
eccns := gjson.Get(priceRatioCache, "eccn."+sortString).String()
if eccns != "" {
eccnList := strings.Split(eccns, "")
eccnList := strings.Split(eccns, "@€@")
fmt.Println(eccnList)
//找到有对应的eccn,那么优先级肯定是最高的了
for _, eccn := range eccnList {
......
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