zwxi 10 months ago
parent
commit
3575f6a36c
2 changed files with 6 additions and 13 deletions
  1. 3 3
      controllers/article.go
  2. 3 10
      services/wx_category_template_msg.go

+ 3 - 3
controllers/article.go

@@ -309,9 +309,9 @@ func (this *ArticleController) Detail() {
 				//30分钟之内阅读同一篇文章不错二次推送
 				key := "CYGX_ARTICLE_READ" + strconv.Itoa(articleId) + "_" + strconv.Itoa(uid)
 				if !utils.Rc.IsExist(key) {
-					//go services.ArticleUserRemind(user, detail, 1)
+					go services.ArticleUserRemind(user, detail, 1)
 					// 互动提醒
-					go services.SendWxCategoryMsgInteractive(user, "阅读报告", articleId)
+					go services.SendWxCategoryMsgInteractive(user, "阅读报告", articleId, detail.Title)
 					utils.Rc.Put(key, 1, 30*time.Second)
 				}
 			} else { //无该行业权限
@@ -546,7 +546,7 @@ func (this *ArticleController) ArticleCollect() {
 		//go services.ArticleUserRemind(user, detail, 2)
 		go services.ArticleHistoryUserLabelLogAdd(articleId, user.UserId)
 		// 互动提醒
-		go services.SendWxCategoryMsgInteractive(user, "收藏报告", articleId)
+		go services.SendWxCategoryMsgInteractive(user, "收藏报告", articleId, detail.Title)
 	} else {
 		err = models.RemoveArticleCollect(uid, articleId)
 		if err != nil {

+ 3 - 10
services/wx_category_template_msg.go

@@ -630,7 +630,7 @@ func SendWxCategoryMsgSpecialFollow(specialId int) (err error) {
 }
 
 // 文章互动相关类目模版消息
-func SendWxCategoryMsgInteractive(user *models.WxUserItem, interactive string, articleId int) (err error) {
+func SendWxCategoryMsgInteractive(user *models.WxUserItem, interactive string, articleId int, title string) (err error) {
 	//30秒内阅读同一篇报告不做重复推送
 	key := "CYGX_" + utils.CYGX_OBJ_RESEARCHSUMMARY + "_READ" + strconv.Itoa(articleId) + "_" + strconv.Itoa(user.UserId)+ "_CATEGORY"
 	if utils.Rc.IsExist(key) {
@@ -667,18 +667,11 @@ func SendWxCategoryMsgInteractive(user *models.WxUserItem, interactive string, a
 		if len(openIdList) == 0 {
 			return
 		}
-		detail, e := models.GetCygxResearchSummaryInfoById(articleId)
-		if e != nil {
-			err = errors.New("GetCygxProductInteriorDetail, Err: " + e.Error())
-			return
-		}
-		if detail == nil {
-			return
-		}
+
 		keyword1 = user.RealName + "-" + user.CompanyName
 		keyword1 = utils.TruncateActivityNameString(keyword1)
 		keyword2 = fmt.Sprint("互动提醒:", interactive)
-		keyword3 = detail.Title
+		keyword3 = utils.TruncateActivityNameString(title)
 		keyword4 = time.Now().Format(utils.FormatDateTimeMinute2)
 		openIdArr := make([]string, 0)
 		for _, v := range openIdList {