|
@@ -171,6 +171,20 @@ func (this *AreaPack) CreateOrder() {
|
|
if orderid <= 0 {
|
|
if orderid <= 0 {
|
|
return nil, fmt.Errorf("创建订单异常")
|
|
return nil, fmt.Errorf("创建订单异常")
|
|
}
|
|
}
|
|
|
|
+ //绑定卡卷
|
|
|
|
+ if (userLotteryId != "" && lotteryId != "") || (discountId > 0) {
|
|
|
|
+ go func(userId, userLotteryId, order_code string) {
|
|
|
|
+ phone, nickname := util.GetMyPhoneAndName(userId)
|
|
|
|
+ if !util.UpdateCouponState(userId, userLotteryId, nickname, phone, order_code, "省份订阅包", strconv.Itoa(discountId), 3, 0) {
|
|
|
|
+ log.Println(fmt.Sprintf("单号%s-绑定失败-卡卷%s", order_code, userLotteryId))
|
|
|
|
+ }
|
|
|
|
+ if discountId > 0 {
|
|
|
|
+ if ulid := util.FindUserLotteryId(userId, orderid, discountId); ulid != 0 {
|
|
|
|
+ userLotteryId = strconv.Itoa(ulid)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }(userId, userLotteryId, orderCode)
|
|
|
|
+ }
|
|
return map[string]interface{}{
|
|
return map[string]interface{}{
|
|
"orderCode": orderCode,
|
|
"orderCode": orderCode,
|
|
}, nil
|
|
}, nil
|