浏览代码

no message

xingzai 6 月之前
父节点
当前提交
c27530f09c
共有 2 个文件被更改,包括 6 次插入4 次删除
  1. 4 2
      controllers/yanxuan_special_message.go
  2. 2 2
      services/wechat_send_category_template_msg.go

+ 4 - 2
controllers/yanxuan_special_message.go

@@ -84,16 +84,18 @@ func (this *YanxuanSpecialMessageController) MessageAdd() {
 		br.ErrMsg = "留言失败,Err:" + err.Error()
 		return
 	}
-
+	var msgText string
 	if parentId == 0 {
+		msgText = "留言成功"
 		go services.SendWxCategoryMsgByYanxuanSpecialMassageByAuthor(content, yanxuanSpecialBySpeciaDetail)
 	} else {
+		msgText = "回复成功"
 		go services.SendWxCategoryMsgByYanxuanSpecialMassage(parentId, int(messageId), content, yanxuanSpecialBySpeciaDetail)
 	}
 
 	br.Ret = 200
 	br.Success = true
-	br.Msg = "留言成功"
+	br.Msg = msgText
 }
 
 // @Title 留言管理列表

+ 2 - 2
services/wechat_send_category_template_msg.go

@@ -844,7 +844,7 @@ func SendWxCategoryMsgByYanxuanSpecialMassageByAuthor(content string, yanxuanSpe
 	var mobile string
 	//mobile = utils.WxMsgTemplateIdAskMsgMobilePublic
 	keyword1 = "专栏文章有新的留言"
-	keyword2 = content
+	keyword2 = utils.TruncateActivityNameString(content)
 
 	userInfo, e := models.GetWxUserItemByUserId(yanxuanSpecialBySpeciaDetail.UserId)
 	if e != nil {
@@ -902,7 +902,7 @@ func SendWxCategoryMsgByYanxuanSpecialMassage(parentId, messageId int, content s
 	var mobile string
 	keyword1 = yanxuanSpecialBySpeciaDetail.Title
 	keyword2 = "作者回复了您的留言"
-	keyword3 = content
+	keyword3 = utils.TruncateActivityNameString(content)
 	keyword4 = time.Now().Format(utils.FormatDateTimeMinute2)
 	if utils.RunMode == "release" {
 		redirectUrl = utils.WX_MSG_PATH_YX_SPECIAL_MASSAGE_DETAIL + strconv.Itoa(messageId)