Pārlūkot izejas kodu

Merge branch 'cygx_10.9' into debug

# Conflicts:
#	services/activity.go
ziwen 1 gadu atpakaļ
vecāks
revīzija
9b1442a58e
3 mainītis faili ar 39 papildinājumiem un 0 dzēšanām
  1. 4 0
      controllers/activity.go
  2. 34 0
      services/activity.go
  3. 1 0
      utils/constants.go

+ 4 - 0
controllers/activity.go

@@ -862,6 +862,10 @@ func (this *ActivityCoAntroller) SignupAdd() {
 	if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
 		resp.IsResearch = true
 	}
+	if activityInfo.ActivityTypeId == 5 {
+		go services.ActivityUserRemind(user, activityInfo, 4)
+	}
+
 
 	//公司线下调研活动客户报名后给建会人,所属销售推送模板信息
 	if signupStatus == "Success" {

+ 34 - 0
services/activity.go

@@ -2190,6 +2190,40 @@ func ActivityUserRemind(user *models.WxUserItem, activityDetail *models.Activity
 	keyword1 = activityDetail.ActivityName
 	keyword2 = fmt.Sprint("互动:", sourceMsg, ",", user.RealName, "--", user.CompanyName)
 	SendWxMsgWithActivityUserRemind(keyword1, keyword2, openIdList, activityDetail.ActivityId)
+	// 如果是买方研选下的专家沙龙,同时推给内容组四人
+	if activityDetail.ActivityTypeId == 5 {
+		configCode := utils.TPL_MSG_NEI_RONG_ZU
+		cnf, e := models.GetConfigByCode(configCode)
+		if e != nil {
+			err = errors.New("GetConfigByCode, Err: " + e.Error() + configCode)
+			return
+		}
+		openIdList, e := models.GetUserRecordListByMobile(4, cnf.ConfigValue)
+		if e != nil && e.Error() != utils.ErrNoRow() {
+			err = errors.New("GetUserRecordListByMobile, Err: " + e.Error() + cnf.ConfigValue)
+			return err
+		}
+		keyword1 := user.RealName + "--" + user.CompanyName + "+" + sellerItemQy.RealName
+		keyword2 := user.Mobile
+		keyword3 := time.Now().Format(utils.FormatDateTime)
+		keyword4 := "报名" + activityDetail.ActivityName
+		openIdArr := make([]string, 0)
+		for _, v := range openIdList {
+			openIdArr = append(openIdArr, v.OpenId)
+		}
+		sendInfo := new(SendWxTemplate)
+		sendInfo.Keyword1 = keyword1
+		sendInfo.Keyword2 = keyword2
+		sendInfo.Keyword3 = keyword3
+		sendInfo.Keyword4 = keyword4
+		sendInfo.TemplateId = utils.WxMsgTemplateIdApplyXzs
+		sendInfo.RedirectTarget = 3
+		sendInfo.Resource = user.Mobile
+		sendInfo.SendType = utils.TEMPLATE_MSG_CYGX_APPLY
+		sendInfo.OpenIdArr = openIdArr
+		err = PublicSendTemplateMsg(sendInfo)
+		return
+	}
 	return
 }
 

+ 1 - 0
utils/constants.go

@@ -213,4 +213,5 @@ const (
 	TPL_MSG_WANG_YANG           = "tpl_msg_wang_yang"           //汪洋手机号地址参数
 	TPL_MSG_WANG_FANG_WANG_YANG = "tpl_msg_wang_fang_wang_yang" //权限模板消息接收人,王芳,汪洋
 	TPL_MSG                     = "tpl_msg"                     //王芳手机号地址参数
+	TPL_MSG_NEI_RONG_ZU         = "tpl_msg_nei_rong_zu"         //内容组四人
 )