|
@@ -79,25 +79,6 @@ func (n *NoMsgTipJob) Execute(taskType, hour int) {
|
|
logger.Info("无消息提醒任务", taskType, "无消息提醒开关 关闭状态,过滤掉", user.Id)
|
|
logger.Info("无消息提醒任务", taskType, "无消息提醒开关 关闭状态,过滤掉", user.Id)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if user.SonAccountStatus == 1 {
|
|
|
|
- if user.MemberMainid == "" {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- mm, mok := Mgo.FindById(Mgo_User, user.MemberMainid, UserCollFields)
|
|
|
|
- if !mok || mm == nil {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- mUser := NewUserInfo(*mm, 3)
|
|
|
|
- if len(mUser.SubSet.Keys) == 0 {
|
|
|
|
- logger.Info("无消息提醒任务", taskType, "主账号没有订阅词,过滤掉", user.Id, user.MemberMainid)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if len(user.SubSet.Keys) == 0 {
|
|
|
|
- logger.Info("无消息提醒任务", taskType, "没有订阅词,过滤掉", user.Id)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
if taskType == 1 || (taskType == 6 && user.PushSet.SubSet.RateMode == 1) || (taskType == 2 && user.PushSet.SubSet.RateMode == 2) || (taskType == 3 && user.PushSet.SubSet.RateMode == 3) ||
|
|
if taskType == 1 || (taskType == 6 && user.PushSet.SubSet.RateMode == 1) || (taskType == 2 && user.PushSet.SubSet.RateMode == 2) || (taskType == 3 && user.PushSet.SubSet.RateMode == 3) ||
|
|
(taskType == 4 && user.PushSet.SubSet.RateMode == 4) || (taskType == 5 && (user.PushSet.SubSet.RateMode == 3 || user.PushSet.SubSet.RateMode == 4)) {
|
|
(taskType == 4 && user.PushSet.SubSet.RateMode == 4) || (taskType == 5 && (user.PushSet.SubSet.RateMode == 3 || user.PushSet.SubSet.RateMode == 4)) {
|
|
n.tip(taskType, hour, user)
|
|
n.tip(taskType, hour, user)
|
|
@@ -161,7 +142,7 @@ func (n *NoMsgTipJob) tip(taskType, hour int, user *UserInfo) {
|
|
logger.Info("无消息提醒任务", taskType, "mysql判断用户该时间段推送过,过滤掉", startUnix, endUnix, user.Id)
|
|
logger.Info("无消息提醒任务", taskType, "mysql判断用户该时间段推送过,过滤掉", startUnix, endUnix, user.Id)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- firstTitle, mailContent, infoCount := VarRecommend.SubRecommend(Clickhouse, Config.JianyuDomain, user.Id, Config.NoMsgTip.Mail.Content, user.PushSet.SubSet.MailPush)
|
|
|
|
|
|
+ firstTitle, area, mailContent, infoCount := VarRecommend.SubRecommend(Clickhouse, Config.JianyuDomain, user.Id, Config.NoMsgTip.Mail.Content, user.PushSet.SubSet.MailPush)
|
|
if infoCount == 0 {
|
|
if infoCount == 0 {
|
|
logger.Info("无消息提醒任务", taskType, "没有要推荐的信息,过滤掉", user.Id)
|
|
logger.Info("无消息提醒任务", taskType, "没有要推荐的信息,过滤掉", user.Id)
|
|
return
|
|
return
|
|
@@ -170,7 +151,7 @@ func (n *NoMsgTipJob) tip(taskType, hour int, user *UserInfo) {
|
|
logger.Info("无消息提醒任务", taskType, "开始推送", user.Id, "rateMode", user.PushSet.SubSet.RateMode, "jpushid", user.Jpushid, "opushid", user.Opushid, "appponetype", user.AppPhoneType, "email", user.PushSet.Email)
|
|
logger.Info("无消息提醒任务", taskType, "开始推送", user.Id, "rateMode", user.PushSet.SubSet.RateMode, "jpushid", user.Jpushid, "opushid", user.Opushid, "appponetype", user.AppPhoneType, "email", user.PushSet.Email)
|
|
if user.PushSet.SubSet.WxPush == 1 {
|
|
if user.PushSet.SubSet.WxPush == 1 {
|
|
logger.Info("无消息提醒任务", taskType, "开始微信推送", user.Id)
|
|
logger.Info("无消息提醒任务", taskType, "开始微信推送", user.Id)
|
|
- isPushOk := n.sendWeixin(user, firstTitle, infoCount)
|
|
|
|
|
|
+ isPushOk := n.sendWeixin(user, firstTitle, area, infoCount)
|
|
logger.Info("无消息提醒任务", taskType, "微信推送结束", isPushOk, user.Id)
|
|
logger.Info("无消息提醒任务", taskType, "微信推送结束", isPushOk, user.Id)
|
|
}
|
|
}
|
|
if user.PushSet.SubSet.AppPush == 1 {
|
|
if user.PushSet.SubSet.AppPush == 1 {
|
|
@@ -195,15 +176,7 @@ func (n *NoMsgTipJob) tip(taskType, hour int, user *UserInfo) {
|
|
}
|
|
}
|
|
|
|
|
|
//推送微信
|
|
//推送微信
|
|
-func (n *NoMsgTipJob) sendWeixin(user *UserInfo, firstTitle string, infoCount int) bool {
|
|
|
|
- subSet := user.SubSet
|
|
|
|
- if user.SonAccountStatus == 1 {
|
|
|
|
- mainUser, _ := Mgo.FindById(Mgo_User, user.MemberMainid, UserCollFields)
|
|
|
|
- if mainUser != nil && len(*mainUser) > 0 {
|
|
|
|
- subSet = NewUserInfo(*mainUser, 3).SubSet
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- _, wxtplmsg_area := GetWxTplMsg(subSet)
|
|
|
|
|
|
+func (n *NoMsgTipJob) sendWeixin(user *UserInfo, firstTitle, area string, infoCount int) bool {
|
|
tmplData := map[string]*qrpc.TmplItem{
|
|
tmplData := map[string]*qrpc.TmplItem{
|
|
"thing3": &qrpc.TmplItem{
|
|
"thing3": &qrpc.TmplItem{
|
|
Value: "智能推荐",
|
|
Value: "智能推荐",
|
|
@@ -212,13 +185,13 @@ func (n *NoMsgTipJob) sendWeixin(user *UserInfo, firstTitle string, infoCount in
|
|
Value: firstTitle,
|
|
Value: firstTitle,
|
|
},
|
|
},
|
|
"thing7": &qrpc.TmplItem{
|
|
"thing7": &qrpc.TmplItem{
|
|
- Value: wxtplmsg_area,
|
|
|
|
|
|
+ Value: area,
|
|
},
|
|
},
|
|
"time9": &qrpc.TmplItem{
|
|
"time9": &qrpc.TmplItem{
|
|
Value: NowFormat(Date_Time_Layout),
|
|
Value: NowFormat(Date_Time_Layout),
|
|
},
|
|
},
|
|
"thing6": &qrpc.TmplItem{
|
|
"thing6": &qrpc.TmplItem{
|
|
- Value: fmt.Sprint(infoCount),
|
|
|
|
|
|
+ Value: fmt.Sprintf("%d条", infoCount),
|
|
},
|
|
},
|
|
}
|
|
}
|
|
ok := putil.SendWeixin(user, &qrpc.WxTmplMsg{
|
|
ok := putil.SendWeixin(user, &qrpc.WxTmplMsg{
|