Commit 44001764 by huangchengyi

1.0

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