zwxi 10 月之前
父节点
当前提交
91db547a66
共有 2 个文件被更改,包括 13 次插入5 次删除
  1. 11 3
      controllers/activity.go
  2. 2 2
      utils/config.go

+ 11 - 3
controllers/activity.go

@@ -2,6 +2,7 @@ package controllers
 
 import (
 	"encoding/json"
+	"errors"
 	"fmt"
 	"hongze/hongze_mfyx/models"
 	"hongze/hongze_mfyx/services"
@@ -1456,10 +1457,17 @@ func (this *ActivityCoAntroller) AskAdd() {
 		}
 		// 给所属销售发送消息
 		if sellerItem != nil {
-			openIpItem, _ := models.GetUserRecordByMobile(4, sellerItem.Mobile)
-			if openIpItem != nil && openIpItem.OpenId != "" {
-				//services.SendActivityAskApplyTemplateMsgV2(user.RealName+"——"+user.CompanyName+"("+sellerItem.RealName+")", "提问:"+activityInfo.ActivityName, time.Now().Format(utils.FormatDateTime), req.Content, activityInfo.ActivityName, openIpItem, activityInfo, int(msgId))
+			openIdList, e := models.GetUserRecordListByMobile(4, sellerItem.Mobile+","+utils.WxMsgTemplateIdAskMsgMobilePublic)
+			if e != nil {
+				err = errors.New("GetUserRecordListByMobile, Err: " + e.Error())
+				return
 			}
+			go services.SendWxCategoryMsgWithAsk(user.RealName, user.CompanyName, sellerItem.RealName, time.Now().Format(utils.FormatDateTimeMinute2), "活动提问:"+content, openIdList, req.ActivityId)
+
+			//openIpItem, _ := models.GetUserRecordByMobile(4, sellerItem.Mobile)
+			//if openIpItem != nil && openIpItem.OpenId != "" {
+				//services.SendActivityAskApplyTemplateMsgV2(user.RealName+"——"+user.CompanyName+"("+sellerItem.RealName+")", "提问:"+activityInfo.ActivityName, time.Now().Format(utils.FormatDateTime), req.Content, activityInfo.ActivityName, openIpItem, activityInfo, int(msgId))
+			//}
 		}
 	}
 

+ 2 - 2
utils/config.go

@@ -235,8 +235,8 @@ func init() {
 
 		ShangHaiCrmApiLink = "http://106.15.192.100:8100/"
 		SendWxTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_template_msg"
-		SendWxCategoryTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_category_template_msg"
-		//SendWxCategoryTemplateMsgUrl = "http://8.136.199.33:8086/v1/wechat/send_category_template_msg"
+		//SendWxCategoryTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_category_template_msg"
+		SendWxCategoryTemplateMsgUrl = "http://8.136.199.33:8086/v1/wechat/send_category_template_msg"
 	}
 
 	//查研观向小助手