|
@@ -218,8 +218,9 @@ func (this *vipSubscribeStruct) PayCallBack(param *CallBackParam) bool {
|
|
|
//A.购买超级订阅前是免费用户:则区域默认为免费订阅区域,免费区域为空则默认为北京;
|
|
|
//B.购买超级订阅前是省份订阅包用户:则区域默认为省份订阅包区域,如超级订阅可订阅省份<省份订阅包可用省份,则随机展示省份订阅包的部分区域;
|
|
|
//C.购买超级订阅后,按照默认区域进行推送。
|
|
|
+ var isDefaultArea bool
|
|
|
if vmsg.OrderType == 1 { //新订单
|
|
|
- vmsg.Area = getUserArea(userId, vmsg.NewBuyset.AreaCount) // 处理订阅区域
|
|
|
+ vmsg.Area, isDefaultArea = getUserArea(userId, vmsg.NewBuyset.AreaCount) // 处理订阅区域
|
|
|
flag = JyVipSubStruct.StartSubVip(userid, vmsg, startTime, endTime, false, positionType, entId, entUserId)
|
|
|
} else if vmsg.OrderType == 2 { //仅续费
|
|
|
flag = JyVipSubStruct.RenewSubVip(userid, qutil.ObjToString((*orderdata)["vip_endtime"]))
|
|
@@ -307,6 +308,41 @@ func (this *vipSubscribeStruct) PayCallBack(param *CallBackParam) bool {
|
|
|
}
|
|
|
equityActive.SendPayRaffleMsg()
|
|
|
}
|
|
|
+ if config.Config.RemindSubMsg.Open && isDefaultArea { // p618
|
|
|
+ // 取mgoid 判断订单里的id是不是mgo 不是的话,取缓存中的信息 如果取到mgoid再发消息
|
|
|
+ mgoUid := ""
|
|
|
+ if mgo.IsObjectIdHex(userId) {
|
|
|
+ mgoUid = userId
|
|
|
+ } else {
|
|
|
+ orderKey := fmt.Sprintf("order_%s", orderCode)
|
|
|
+ rs := redis.Get("other", orderKey)
|
|
|
+ info := qutil.ObjToMap(rs)
|
|
|
+ if info != nil && len(*info) > 0 {
|
|
|
+ log.Println("RemindSubMsg 获取到redis保存的用户身份信息:", orderKey, info)
|
|
|
+ mgoUid = qutil.ObjToString((*info)["mgoId"])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if mgoUid != "" {
|
|
|
+ siteMsg := config.Config.RemindSubMsg.SiteMsg
|
|
|
+ sessData := fmt.Sprintf("%s,_id,%s,subVipSetPage", mgoUid, now)
|
|
|
+
|
|
|
+ weChatUrl := fmt.Sprintf(siteMsg.WeChatUrl, util.Se_Topnet.EncodeString(sessData))
|
|
|
+ // 发送站内信
|
|
|
+ p := util.MessageParam{
|
|
|
+ UserIds: mgoUid,
|
|
|
+ Title: siteMsg.Title,
|
|
|
+ Content: siteMsg.Content,
|
|
|
+ MsgType: siteMsg.MsgType,
|
|
|
+ SendMode: 2,
|
|
|
+ Link: siteMsg.Link,
|
|
|
+ IosUrl: siteMsg.IosUrl,
|
|
|
+ AndroidUrl: siteMsg.AndroidUrl,
|
|
|
+ WeChatUrl: weChatUrl,
|
|
|
+ }
|
|
|
+
|
|
|
+ util.EquityActiveSend.SendStationMessages(p)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
return flag
|
|
@@ -315,7 +351,8 @@ func (this *vipSubscribeStruct) PayCallBack(param *CallBackParam) bool {
|
|
|
// 获取用户设置的区域
|
|
|
// A.购买超级订阅前是免费用户:则区域默认为免费订阅区域,免费区域为空则默认为北京;
|
|
|
// B.购买超级订阅前是省份订阅包用户:则区域默认为省份订阅包区域,如超级订阅可订阅省份<省份订阅包可用省份,则随机展示省份订阅包的部分区域;
|
|
|
-func getUserArea(userId string, areaCount int) (area *map[string]interface{}) {
|
|
|
+// isDefaultArea 是否是默认的区域 true:是
|
|
|
+func getUserArea(userId string, areaCount int) (area *map[string]interface{}, isDefaultArea bool) {
|
|
|
if areaCount == -1 {
|
|
|
area = &map[string]interface{}{}
|
|
|
return
|
|
@@ -347,7 +384,9 @@ func getUserArea(userId string, areaCount int) (area *map[string]interface{}) {
|
|
|
o_area := qutil.ObjToMap((*ojy)["o_area"])
|
|
|
if o_area != nil && len(*o_area) > 0 {
|
|
|
area = o_area
|
|
|
+ return
|
|
|
}
|
|
|
+ isDefaultArea = true // 默认的区域
|
|
|
return
|
|
|
}
|
|
|
|