Commit 2400a98a by mushishixian

Merge branch 'ysx-魔方改版-20230313' into dev

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