Commit 2b0f4f7b by huangchengyi

1.0

parent 003c8941
......@@ -208,17 +208,7 @@ 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()) //
//处理活动价
A.Set("ac_type",0)
A.Set("allow_coupon",1)
Ac_price := qs.ActivityPrice(ctx,info,&redisConn)
if Ac_price != nil {
keys := Ac_price.Keys()
for _, k := range keys {
v, _ := Ac_price.Get(k)
A.Set(k,v) //活动价格覆盖
}
}
//处理系数
ratio,_ := gredis.String(redisConn.Do("HGET","zy_ratio_sku",goods_id))
var PriceAc float64 = 0
......@@ -281,6 +271,17 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string, ch ch
}else{
A.Set("is_buy",1)
}
//处理活动价
A.Set("ac_type",0)
A.Set("allow_coupon",1)
Ac_price := qs.ActivityPrice(ctx,info,&redisConn)
if Ac_price != nil {
keys := Ac_price.Keys()
for _, k := range keys {
v, _ := Ac_price.Get(k)
A.Set(k,v) //活动价格覆盖
}
}
//最后写入sync map
(GoodsRes).Store(goods_id,A)
......
......@@ -53,6 +53,8 @@ func (qs *ZiyingService) ActivityPrice(ctx *gin.Context,SkuInfo string,c *redis.
}
//团购限制
data := qs.HDGoodsLimit(gjson.Get(SkuInfo,"goods_id").String(),gjson.Get(SkuInfo,"stock").String(),c)
common.PrintDebugHtml(ctx,data)
if data != nil {
return data
}
......@@ -229,7 +231,7 @@ func (qs *ZiyingService) HDGoodsLimit(SkuID string,Stock string,c *redis.Conn)
ladderType := make([]model.LadderPrice,0)
for _,v := range ladder_price_arr{
ladderType = append(ladderType, model.LadderPrice{
Purchases: v.Get("Purchases").Int(),
Purchases: v.Get("purchases").Int(),
PriceCn: v.Get("price_cn").Float(),
PriceAc: v.Get("price_ac").Float(),
})
......@@ -253,7 +255,6 @@ func (qs *ZiyingService) HDGoodsLimit(SkuID string,Stock string,c *redis.Conn)
if now_stock > common.MyFloat64(Stock) || now_stock == 0 {
return nil
}
return 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