|
@@ -52,7 +52,6 @@ func DealSend(k *push.MemberInterest, l *list.List, now time.Time, MaxPushSize i
|
|
|
str := fmt.Sprintf("<div>根据您设置的关键词(%s),给您推送以下信息:</div>", strings.Join(k.Interest, ";"))
|
|
|
pushid := "" //推送记录id
|
|
|
mailContent := ""
|
|
|
- jpushtitle := ""
|
|
|
//发送内容组合
|
|
|
i := 0
|
|
|
lastInfoDate := int64(0)
|
|
@@ -67,8 +66,6 @@ func DealSend(k *push.MemberInterest, l *list.List, now time.Time, MaxPushSize i
|
|
|
for _, ks := range sl {
|
|
|
k2 := *ks
|
|
|
title := strings.Replace(k2["title"].(string), "\n", "", -1)
|
|
|
- otitle := strings.Replace(k2["otitle"].(string), "\n", "", -1)
|
|
|
- jpushtitle += otitle + ","
|
|
|
if !publishTitle[title] {
|
|
|
if filterData.IsExists(util.BsonIdToSId(k2["_id"])) {
|
|
|
continue
|
|
@@ -195,7 +192,6 @@ func DealSend(k *push.MemberInterest, l *list.List, now time.Time, MaxPushSize i
|
|
|
|
|
|
//发送微信:1,3
|
|
|
//wid := ""
|
|
|
- bsavewx := false
|
|
|
if k.Type == 0 && (k.PushMode == 1 || k.PushMode == 3) && len(k.Openid) > 0 && k.IsPush != 0 {
|
|
|
Tip1 := util.If(TmpTip == "", "", TmpTip+":\n").(string)
|
|
|
LastTip := ""
|
|
@@ -246,7 +242,6 @@ func DealSend(k *push.MemberInterest, l *list.List, now time.Time, MaxPushSize i
|
|
|
//-------------长度计算完成------------------
|
|
|
log.Println(k.Ratemode, "-----", k.PushMode, "-----", k.Openid)
|
|
|
pushid = SendWeixin(k, str, now, Tip1+WXTitle+LastTip, o_pushinfo, ratemode, infoTypeName)
|
|
|
- bsavewx = true
|
|
|
}
|
|
|
//发送邮件
|
|
|
if bmail {
|
|
@@ -254,17 +249,24 @@ func DealSend(k *push.MemberInterest, l *list.List, now time.Time, MaxPushSize i
|
|
|
html := fmt.Sprintf(push.Mail_html, strings.Replace(strings.Join(k.Interest, ";"), "+", " ", -1), mailContent)
|
|
|
subject := fmt.Sprintf(push.Mail_title, infoTypeName)
|
|
|
SendFmail(k.Email, subject, html, k.Dataexport, fmdatas)
|
|
|
- if !bsavewx { //保存信息
|
|
|
- push.SaveSendInfo(k, now, html, o_pushinfo, ratemode)
|
|
|
- bsavewx = true
|
|
|
+ if pushid == "" { //保存信息
|
|
|
+ pushid = push.SaveSendInfo(k, now, str, o_pushinfo, ratemode)
|
|
|
}
|
|
|
}
|
|
|
//app推送1,3
|
|
|
if (k.Type == 1 || k.Type == 2) && k.Jpushid != "" && (k.PushMode == 1 || k.PushMode == 3) {
|
|
|
- if !bsavewx { //app,app+邮件,推送记录
|
|
|
+ if pushid == "" { //app,app+邮件,推送记录
|
|
|
pushid = push.SaveSendInfo(k, time.Now(), str, o_pushinfo, ratemode)
|
|
|
}
|
|
|
log.Println("极光推送", k.Ratemode, "-----", k.PushMode, "-----", k.Openid, "-----", k.Jpushid)
|
|
|
+ jpushtitle := strings.Replace((*sl[0])["otitle"].(string), "\n", "", -1)
|
|
|
+ ks_length := len(sl)
|
|
|
+ if ks_length > MaxPushSize {
|
|
|
+ ks_length = MaxPushSize
|
|
|
+ }
|
|
|
+ if ks_length > 1 {
|
|
|
+ jpushtitle = "1. " + jpushtitle + "\n...(共" + fmt.Sprint(ks_length) + "条)"
|
|
|
+ }
|
|
|
go jgpush.JgpushNc(jpushtitle, "bid", []string{k.Jpushid}, map[string]interface{}{
|
|
|
"url": "/jyapp/free/sess/" + push.Se.EncodeString(k.Openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",wxpushlist") + "__" + pushid,
|
|
|
"openid": k.Openid,
|