Commit 44001764 by huangchengyi

1.0

parent 3e0759da
Showing with 9 additions and 6 deletions
......@@ -206,14 +206,12 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
}
A.Set("scm_brand_name", gjson.Get(info, "scm_brand_name").String()) //
A.Set("ac_type", gjson.Get(info, "ac_type").Int()) //
//处理系数
ratio,_ := gredis.String(redisConn.Do("HGET","zy_ratio_sku",goods_id))
var PriceAc float64 = 0
var PriceAcXi float64 = 0 //系数
if ratio != "" {
PriceAc = gjson.Get(ratio,"price_ac").Float()
PriceAcXi = gjson.Get(ratio,"price_ac").Float()
//获取立创价格
if gjson.Parse("szlc_price").String() == "" {
A.Set("szlc_price",nil)
......@@ -230,6 +228,7 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
A.Set("allow_coupon",gjson.Get(ratio,"allow_coupon").String())
A.Set("allow_presale",gjson.Get(ratio,"allow_presale").String())
A.Set("ac_type", 6) //系数
}
//拼接梯度价格
......@@ -239,7 +238,7 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
if v.Get("purchases").String() == "" {
continue;
}
if PriceAc == 0 {
if PriceAcXi == 0 {
ladderPrice = append(ladderPrice, model.LadderPrice{
Purchases: v.Get("purchases").Int(),
PriceCn: v.Get("price_cn").Float(),
......@@ -248,9 +247,10 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
ladderPrice = append(ladderPrice, model.LadderPrice{
Purchases: v.Get("purchases").Int(),
PriceCn: v.Get("price_cn").Float(),
PriceAc: PriceAc,
PriceAc: PriceAcXi,
})
}
}
if len(ladderPrice) == 0 {
......@@ -271,6 +271,8 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
}else{
A.Set("is_buy",1)
}
if PriceAcXi == 0 { //没有系数价格才处理活动价
//处理活动价
A.Set("ac_type",0)
A.Set("allow_coupon",1)
......@@ -282,6 +284,7 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
A.Set(k,v) //活动价格覆盖
}
}
}
//最后写入sync map
(GoodsRes).Store(goods_id,A)
......
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