Commit be38dbb1 by mushishixian

自营活动价匹配规则问题

parent 6990120c
Showing with 13 additions and 1 deletions
......@@ -3,6 +3,7 @@ package service
import (
"go_sku_server/model"
"go_sku_server/pkg/common"
"go_sku_server/pkg/gredis"
"github.com/gin-gonic/gin"
"github.com/gomodule/redigo/redis"
......@@ -50,10 +51,21 @@ func (qs *ZiyingService) ActivityPrice(ctx *gin.Context, SkuInfo string) *ordere
//获取活动相关信息
func (qs *ZiyingService) GetActivity(skuInfo string) (priceActivity model.PriceActivity, giftActivity model.GiftActivity) {
//去判断是否有活动(促销打折活动和满赠活动)
var standardBrandId int
spuId := gjson.Get(skuInfo, "spu_id").String()
redisCon := gredis.Conn("default_r")
spuStr, _ := redis.String(redisCon.Do("HGET", "spu", spuId))
defer redisCon.Close()
if spuStr == "" {
standardBrandId = 0
} else {
brandId := gjson.Get(spuStr, "brand_id").Int()
standardBrandId, _ = redis.Int(redisCon.Do("HGET", "standard_brand_mapping", brandId))
}
checkData := model.ActivityCheckData{
SupplierId: 10000,
BrandId: int(gjson.Get(skuInfo, "brand_id").Int()),
StandardBrandId: int(gjson.Get(skuInfo, "standard_brand.standard_brand_id").Int()),
StandardBrandId: standardBrandId,
GoodsId: gjson.Get(skuInfo, "goods_id").String(),
ClassId: int(gjson.Get(skuInfo, "class_id2").Int()),
}
......
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