Commit 560140ec by mushishixian

fix

parent 836a8ec3
Showing with 5 additions and 1 deletions
......@@ -63,6 +63,7 @@ type LySku struct {
//活动信息
ActivityEndTime int64 `json:"activity_end_time,omitempty"`
ActivityInfo map[string]interface{} `json:"activity_info,omitempty"`
Content interface{} `json:"content"`
}
//为什么不直接映射到结构,而要用gjson,因为redis存的数据结构不一定正常,可能类型不一致
......
......@@ -14,6 +14,7 @@ import (
//获取联营活动价
func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Power) model.LySku {
//没价格,直接返回
var contentSlice []interface{}
if len(sku.LadderPrice) == 0 {
return sku
}
......@@ -22,13 +23,15 @@ func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Powe
if suffix == "" && sku.SupplierId == 14 {
return getMouserActivityPrice(sku)
}
contentSlice = append(contentSlice,sku)
//先获取活动信息,针对不同供应商不同活动类型做活动吗,每个活动只能针对一个供应商
//比如有 Self_ActivityPrice_2_Discount,Self_ActivityPrice_1_NewCustomer
redisCon := gredis.Conn("default_r")
defer redisCon.Close()
supplierIdStr := strconv.Itoa(int(sku.SupplierId))
activityInfo, _ := redis.String(redisCon.Do("GET", "Self_ActivityPrice_"+supplierIdStr+suffix))
contentSlice = append(contentSlice,activityInfo)
//找不到对应的活动价格信息,就直接返回空
if activityInfo == "" {
return sku
......
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