Commit f30f1ec7 by huangchengyi

1.0

parent 7d1eb42a
Showing with 3 additions and 2 deletions
......@@ -177,8 +177,9 @@ func (a *ZyCronService) ZyDiscount(checkGoodsId string) {
//查询立创数据
szlcPriceStr,_ := gredis.String(redisConn.Do("HGET","Self_szlc_price",now_goods_id)) //获取立创价格
if szlcPriceStr != "" { //有立创的价格
nowLadder := gjson.Get(a["ladder_price"], "purchases").Array()
nowLadder := gjson.Parse(a["ladder_price"]).Array()
endnowLadder := nowLadder[len(nowLadder)-1].Get("purchases").Int() //最后一个梯度
fmt.Println(endnowLadder)
//获取立创对应的梯度价格
szlcPriceArr := gjson.Parse(szlcPriceStr).Array()
var szlcPrice float64 =0 //找到立创对应的梯度价格
......@@ -189,7 +190,7 @@ func (a *ZyCronService) ZyDiscount(checkGoodsId string) {
}
szlcPrice = szlcPrice*0.95 //立创95折
if ratioPrice > szlcPrice { //比立创的95折大
minPrice := common.MyFloat64(a["cost"]) * common.MyFloat64(info["min_ratio"])
minPrice := math.Ceil(gconv.Float64(a["cost"]) * gconv.Float64(info["min_ratio"])*10000)/10000
if szlcPrice < minPrice {
ratioPrice = minPrice
}else{
......
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