|
@@ -40,7 +40,7 @@ func (p *Pjob) DoPush(mopenid, stime string, opr int, ltime int64) bool {
|
|
|
*p.Cache = push.InitCache(p.Stype, mopenid)
|
|
|
p.CreateUserInterestWord()
|
|
|
EachAllBidInfo(p.Stype, "["+p.StypeName+"信息]", p.StypeName, ltime, p.MaxPushSize, p.Dfa, p.Cache, opr)
|
|
|
- return false
|
|
|
+ return true
|
|
|
}
|
|
|
|
|
|
//遍历数据并执行推送操作
|
|
@@ -99,18 +99,18 @@ L1:
|
|
|
}
|
|
|
now := time.Now()
|
|
|
if pushType == 1 && returnLastTime != nil {
|
|
|
- push.PushConfig[stype+"rStartTime"] = util.FormatDateWithObj(&returnLastTime, util.Date_Full_Layout)
|
|
|
+ push.PushConfig[stype+"StartTime"] = util.FormatDateWithObj(&returnLastTime, util.Date_Full_Layout)
|
|
|
}
|
|
|
for k, v := range *(userMap) {
|
|
|
kk := *k
|
|
|
vv := *v
|
|
|
time.Sleep(50 * time.Millisecond)
|
|
|
- go Send(&kk, &vv, now, TITLEA, ShortTitle, MaxPushSize)
|
|
|
+ go Send(&kk, &vv, now, TITLEA, ShortTitle, stype, MaxPushSize)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//全局推送功能
|
|
|
-func Send(k *push.MemberInterest, v *list.List, now time.Time, TITLEA, ShortTitle string, MaxPushSize int) {
|
|
|
+func Send(k *push.MemberInterest, v *list.List, now time.Time, TITLEA, ShortTitle, stype string, MaxPushSize int) {
|
|
|
defer func() {
|
|
|
if r := recover(); r != nil {
|
|
|
log.Println("[E]", r)
|
|
@@ -170,13 +170,13 @@ func Send(k *push.MemberInterest, v *list.List, now time.Time, TITLEA, ShortTitl
|
|
|
|
|
|
//3、发送微信
|
|
|
if len(k.Openid) > 0 {
|
|
|
- SendWeixin(k, TITLE, ShortTitle, str, "", now, WXTitle, publishTimes)
|
|
|
+ SendWeixin(k, TITLE, ShortTitle, str, stype, now, WXTitle, publishTimes)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//推送微信
|
|
|
-func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, wxstr string, now time.Time, WXTitle string, publishTimes map[string]interface{}) {
|
|
|
+func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, stype string, now time.Time, WXTitle string, publishTimes map[string]interface{}) {
|
|
|
defer func() {
|
|
|
if r := recover(); r != nil {
|
|
|
fmt.Println("发送微信[E]", r)
|
|
@@ -192,7 +192,7 @@ func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, wxstr string, no
|
|
|
"s_province": k.Province,
|
|
|
"a_interest": k.Interest,
|
|
|
"s_content": str,
|
|
|
- "s_type": "tender",
|
|
|
+ "s_type": stype,
|
|
|
"a_publishtime": publishTimes,
|
|
|
"i_size": len(publishTimes),
|
|
|
}
|
|
@@ -208,10 +208,10 @@ func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, wxstr string, no
|
|
|
wxDate = time.Now().Local().Add(time.Duration(-n2) * time.Second).Add(time.Duration(-n1*24) * time.Hour).Format(util.Date_Full_Layout)
|
|
|
}
|
|
|
|
|
|
- wxstr = "\n点击下方“详情”查看详细信息。\n以上" + ShortTitle + "信息,是剑鱼根据关键字“" + strings.Join(k.Interest, ";") + "”奋力查找并推送,如不合您心意,请猛戳企明星菜单“会员服务—剑鱼”进行修改。"
|
|
|
+ wxstr := "\n点击下方“详情”查看详细信息。\n以上" + ShortTitle + "信息,是剑鱼根据关键字“" + strings.Join(k.Interest, ";") + "”奋力查找并推送,如不合您心意,请猛戳企明星菜单“会员服务—剑鱼”进行修改。"
|
|
|
push.SendWinXin(&qrpc.NotifyMsg{
|
|
|
Openid: k.Openid,
|
|
|
- Title: push.PushConfig["tenderTitle"].(string),
|
|
|
+ Title: push.PushConfig[stype+"Title"].(string),
|
|
|
Remark: wxstr,
|
|
|
Detail: WXTitle,
|
|
|
Date: wxDate,
|