|
@@ -504,7 +504,7 @@ func (this *CommonAction) Createorder() {
|
|
|
//获取卡券相关
|
|
|
lotteryId := qutil.ObjToString(data["lotteryId"]) //卡卷信息的id
|
|
|
discountId := qutil.ObjToString(data["discountId"]) //赠品相关
|
|
|
- //i_discountId, _ := strconv.Atoi(discountId)
|
|
|
+ i_discountId, _ := strconv.Atoi(discountId)
|
|
|
inserMap, msg := entity.JyCommonOrderStruct.InserMap(product, productId, userid, lotteryId, discountId, data, this.Session())
|
|
|
//错误信息
|
|
|
if msg != "" {
|
|
@@ -537,17 +537,19 @@ func (this *CommonAction) Createorder() {
|
|
|
insertM["vip_starttime"] = inserMap.VipStartTime
|
|
|
insertM["vip_endtime"] = inserMap.VipEndTime
|
|
|
}
|
|
|
- // filterStr, _ := json.Marshal(filterStruct.Filter)
|
|
|
- // insertM["filter"] = string(filterStr)
|
|
|
orderid := util.Mysql.Insert("dataexport_order", insertM)
|
|
|
if orderid <= 0 {
|
|
|
return nil, fmt.Errorf("创建订单异常")
|
|
|
}
|
|
|
+ if i_discountId > 0 {
|
|
|
+ go util.FindUserLotteryId(userid, orderid, i_discountId)
|
|
|
+ }
|
|
|
rdata := map[string]interface{}{"order_code": inserMap.OrderCode, "needPay": !inserMap.UnNeedPay}
|
|
|
return rdata, nil
|
|
|
}()
|
|
|
if errMsg != nil {
|
|
|
log.Printf("%s CreateOrder 异常:%s\n", userid, errMsg.Error())
|
|
|
}
|
|
|
+ //创建完订单后更新卡券信息
|
|
|
this.ServeJson(NewResult(rData, errMsg))
|
|
|
}
|