zhangxinlei1996 3 éve
szülő
commit
2ac7a66b8c
1 módosított fájl, 12 hozzáadás és 0 törlés
  1. 12 0
      src/jfw/modules/subscribepay/src/entity/areaPack.go

+ 12 - 0
src/jfw/modules/subscribepay/src/entity/areaPack.go

@@ -2,6 +2,7 @@ package entity
 
 import (
 	"encoding/json"
+	"fmt"
 	"log"
 	qutil "qfw/util"
 	"time"
@@ -169,6 +170,17 @@ func (this *areaPackPrice) PayCallBack(param *CallBackParam) bool {
 				log.Printf("用户%s更新省份订阅包用户状态出错:%v", userId, areaPack)
 				return false
 			}
+			//卡卷使用
+			userLotteryId := qutil.ObjToString((*orderData)["d_relation_id"])
+			order_code := qutil.ObjToString((*orderData)["order_code"])
+			if userLotteryId != "" {
+				go func(userId, userLotteryId, order_code string) {
+					phone, name := util.GetMyPhoneAndName(userId)
+					if !util.UpdateCouponState(userId, userLotteryId, name, phone, order_code, "省份订阅包", "0", 1, 0) {
+						log.Println(fmt.Sprintf("单号%s-消费失败-卡卷%s", order_code, userLotteryId))
+					}
+				}(userId, userLotteryId, order_code)
+			}
 			return true
 		} else {
 			return true