Commit 9539e110 by mushishixian

debug

parent 0ff12139
Showing with 9 additions and 4 deletions
...@@ -23,16 +23,12 @@ func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Powe ...@@ -23,16 +23,12 @@ func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Powe
if suffix == "" && sku.SupplierId == 14 { if suffix == "" && sku.SupplierId == 14 {
return getMouserActivityPrice(sku) return getMouserActivityPrice(sku)
} }
contentSlice = append(contentSlice,sku)
sku.Content = contentSlice
//先获取活动信息,针对不同供应商不同活动类型做活动吗,每个活动只能针对一个供应商 //先获取活动信息,针对不同供应商不同活动类型做活动吗,每个活动只能针对一个供应商
//比如有 Self_ActivityPrice_2_Discount,Self_ActivityPrice_1_NewCustomer //比如有 Self_ActivityPrice_2_Discount,Self_ActivityPrice_1_NewCustomer
redisCon := gredis.Conn("default_r") redisCon := gredis.Conn("default_r")
defer redisCon.Close() defer redisCon.Close()
supplierIdStr := strconv.Itoa(int(sku.SupplierId)) supplierIdStr := strconv.Itoa(int(sku.SupplierId))
activityInfo, _ := redis.String(redisCon.Do("GET", "Self_ActivityPrice_"+supplierIdStr+suffix)) activityInfo, _ := redis.String(redisCon.Do("GET", "Self_ActivityPrice_"+supplierIdStr+suffix))
contentSlice = append(contentSlice,activityInfo)
sku.Content = contentSlice
//找不到对应的活动价格信息,就直接返回空 //找不到对应的活动价格信息,就直接返回空
if activityInfo == "" { if activityInfo == "" {
...@@ -49,12 +45,16 @@ contentSlice = append(contentSlice,sku) ...@@ -49,12 +45,16 @@ contentSlice = append(contentSlice,sku)
//获取redis里面存储的活动相关信息 //获取redis里面存储的活动相关信息
brandIdArray := gjson.Get(activityInfo, "brand_id").Array() brandIdArray := gjson.Get(activityInfo, "brand_id").Array()
contentSlice = append(contentSlice, brandIdArray)
sku.Content = contentSlice
var brandIds []string var brandIds []string
for _, brandId := range brandIdArray { for _, brandId := range brandIdArray {
if brandId.String() != "" { if brandId.String() != "" {
brandIds = append(brandIds, brandId.String()) brandIds = append(brandIds, brandId.String())
} }
} }
contentSlice = append(contentSlice, brandIds)
sku.Content = contentSlice
goodsNameArray := gjson.Get(activityInfo, "goods_name").Array() goodsNameArray := gjson.Get(activityInfo, "goods_name").Array()
var goodsNames []string var goodsNames []string
for _, goodsName := range goodsNameArray { for _, goodsName := range goodsNameArray {
...@@ -138,6 +138,8 @@ contentSlice = append(contentSlice,sku) ...@@ -138,6 +138,8 @@ contentSlice = append(contentSlice,sku)
visibleRoster := gjson.Get(activityInfo, "visible_roster").String() visibleRoster := gjson.Get(activityInfo, "visible_roster").String()
if suffix == "_Member" && gjson.Get(activityInfo, "is_part").Int() == 1 && if suffix == "_Member" && gjson.Get(activityInfo, "is_part").Int() == 1 &&
visibleRoster != "" { visibleRoster != "" {
contentSlice = append(contentSlice, "进来进来")
sku.Content = contentSlice
//为了用字符串匹配 //为了用字符串匹配
visibleRoster = "," + visibleRoster + "," visibleRoster = "," + visibleRoster + ","
//提取出user_id、手机号、邮箱 //提取出user_id、手机号、邮箱
...@@ -190,6 +192,9 @@ contentSlice = append(contentSlice,sku) ...@@ -190,6 +192,9 @@ contentSlice = append(contentSlice,sku)
//} //}
} }
} }
contentSlice = append(contentSlice, "提前返回")
contentSlice = append(contentSlice, hasActivity)
sku.Content = contentSlice
//判断是否有活动 //判断是否有活动
if !hasActivity { if !hasActivity {
return sku 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