|
@@ -76,7 +76,7 @@ func (e *EquityActive) GiftVip() {
|
|
|
go e.sendAlarmMail(activeName, activeId, mold, 0)
|
|
|
return
|
|
|
}
|
|
|
- if len(*eInfo) <= config.Config.EquityActive.MailAlarm.Threshold {
|
|
|
+ if len(*eInfo)-1 <= config.Config.EquityActive.MailAlarm.Threshold {
|
|
|
// 发库存告警时这减去1是因为这一次马上会消耗一个
|
|
|
go e.sendAlarmMail(activeName, activeId, mold, len(*eInfo)-1)
|
|
|
}
|
|
@@ -145,28 +145,24 @@ func (e *EquityActive) findVipStock(activeId, mold int) (data *[]map[string]inte
|
|
|
}
|
|
|
|
|
|
// 根据订单号获取缓存里面的用户id等信息
|
|
|
-func (e *EquityActive) setUserID() (mgoId string, positionId string) {
|
|
|
+func (e *EquityActive) setUserID() {
|
|
|
orderKey := fmt.Sprintf("order_%s", e.OrderCode)
|
|
|
rs := redis.Get("other", orderKey)
|
|
|
info := common.ObjToMap(rs)
|
|
|
- if info == nil || len(*info) == 0 {
|
|
|
+ phone := ""
|
|
|
+ if info != nil && len(*info) > 0 {
|
|
|
log.Println("equityActive 未获取到redis保存的用户身份信息:", orderKey, info)
|
|
|
- return
|
|
|
+ e.mgoId = common.ObjToString((*info)["mgoId"])
|
|
|
+ e.positionId = fmt.Sprintf("%v", common.IntAll((*info)["positionId"]))
|
|
|
+ phone = common.ObjToString((*info)["phone"])
|
|
|
}
|
|
|
- mgoId = common.ObjToString((*info)["mgoId"])
|
|
|
- positionId = fmt.Sprintf("%v", common.IntAll((*info)["positionId"]))
|
|
|
- phone := common.ObjToString((*info)["phone"])
|
|
|
if phone != "" {
|
|
|
e.Phone = phone
|
|
|
}
|
|
|
- e.mgoId = mgoId
|
|
|
- e.positionId = positionId
|
|
|
- if mgoId == "" && bson.IsObjectIdHex(e.UserId) {
|
|
|
- // 如果没有redis取到说明是代用户下单的订单
|
|
|
- // 代用户下单的现在只有个人版的 所以可以直接从订单里面取用户mgoId
|
|
|
- if bson.IsObjectIdHex(e.UserId) {
|
|
|
- mgoId = e.UserId
|
|
|
- }
|
|
|
+ // 如果没有redis取到说明是代用户下单的订单
|
|
|
+ // 代用户下单的现在只有个人版的 所以可以直接从订单里面取用户mgoId
|
|
|
+ if e.mgoId == "" && bson.IsObjectIdHex(e.UserId) {
|
|
|
+ e.mgoId = e.UserId
|
|
|
}
|
|
|
return
|
|
|
}
|
|
@@ -192,6 +188,7 @@ func (e *EquityActive) sendVipMsg(eName, code, ex_end_time string) {
|
|
|
args3, args4 := "", ""
|
|
|
if len(smsconfig.Args) == 2 {
|
|
|
args3 = fmt.Sprintf(smsconfig.Args[0], eName, code, ex_end_time)
|
|
|
+ args4 = smsconfig.Args[1]
|
|
|
} else {
|
|
|
log.Println("equityActive 视频会员活动短信模板内容参数配置异常,请检查配置文件。")
|
|
|
return
|