|
@@ -168,7 +168,17 @@ func (this *SubscribeChange) SaveChange() {
|
|
|
log.Println(userId+" 前台计算", req_price, "后台计算", final_price)
|
|
|
return &entity.FuncResult{false, errors.New("金额校验异常"), nil}
|
|
|
}
|
|
|
-
|
|
|
+ if entity.SubVipPrice.Discount < 1 {
|
|
|
+ tmp := float64(final_price) * entity.SubVipPrice.Discount
|
|
|
+ if tmp < 1 {
|
|
|
+ if tmp != 0 {
|
|
|
+ final_price = 1
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ final_price = int(tmp)
|
|
|
+ }
|
|
|
+ log.Printf("进行折扣计算 折扣后金额%d\n", final_price)
|
|
|
+ }
|
|
|
//return &entity.FuncResult{true, nil, map[string]interface{}{"price": final_price}}
|
|
|
//创建订单
|
|
|
filterStr, err := json.Marshal(filter)
|