|
@@ -1094,46 +1094,8 @@ func UpdateCygxSubscribe(uid int, unionId string) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// SendPermissionApplyTemplateMsgAdmin 处理试用申请给王芳,汪洋发消息
|
|
|
-func SendPermissionApplyTemplateMsgAdmin(req models.ApplyTryReq, usermobile, applyMethod string, isResearch bool) (err error) {
|
|
|
- defer func() {
|
|
|
- if err != nil {
|
|
|
- go utils.SendAlarmMsg("处理试用申请给王芳,汪洋发消息失败, ErrMsg: "+err.Error(), 3)
|
|
|
- }
|
|
|
- }()
|
|
|
- var configCode string
|
|
|
- //如果是研选的就推送给汪洋跟王芳,否则就推送给王芳
|
|
|
- if isResearch {
|
|
|
- configCode = utils.TPL_MSG_WANG_YANG
|
|
|
- } else {
|
|
|
- configCode = utils.TPL_MSG
|
|
|
- }
|
|
|
- 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
|
|
|
- }
|
|
|
-
|
|
|
- for _, v := range openIdList {
|
|
|
- go SendPermissionApplyTemplateMsg(req.RealName, req.CompanyName, usermobile, applyMethod, v)
|
|
|
- }
|
|
|
-
|
|
|
- //openIpItem, e := models.GetUserRecordByMobile(4, cnf.ConfigValue)
|
|
|
- //if e != nil {
|
|
|
- // err = errors.New("GetUserRecordByMobile, Err: " + e.Error() + cnf.ConfigValue)
|
|
|
- // return
|
|
|
- //}
|
|
|
-
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
// 研选类目模板消息
|
|
|
-func SendPermissionApplyTemplateMsgAdminByYxCategory(req models.ApplyTryReq, companyId int) (err error) {
|
|
|
+func SendPermissionApplyTemplateMsgAdminByYxCategory(req models.ApplyTryReq, companyId int, usermobile, redirectUrl string) (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
go utils.SendAlarmMsg("研选类目模板消息消息失败, SendPermissionApplyTemplateMsgAdminByYxCategoryErrMsg: "+err.Error(), 3)
|
|
@@ -1141,7 +1103,7 @@ func SendPermissionApplyTemplateMsgAdminByYxCategory(req models.ApplyTryReq, com
|
|
|
}()
|
|
|
|
|
|
//潜在客户、未开权益,已开FICC的客户推给王芳,开通权益的客户推给对应销售
|
|
|
- mobile := utils.WxMsgTemplateIdAskMsgMobilePublic
|
|
|
+ mobileOpneid := utils.WxMsgTemplateIdAskMsgMobilePublic
|
|
|
if companyId > 1 {
|
|
|
raiCount, e := models.GetCompanyProductCount(companyId, utils.COMPANY_PRODUCT_RAI_ID)
|
|
|
if e != nil {
|
|
@@ -1156,10 +1118,10 @@ func SendPermissionApplyTemplateMsgAdminByYxCategory(req models.ApplyTryReq, com
|
|
|
err = errors.New("GetRaiSellerByCompanyId, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
- mobile = sealldetail.Mobile
|
|
|
+ mobileOpneid = sealldetail.Mobile
|
|
|
}
|
|
|
|
|
|
- openIdList, e := models.GetMfyxWxOpenIdByMobileList(mobile)
|
|
|
+ openIdList, e := models.GetMfyxWxOpenIdByMobileList(mobileOpneid)
|
|
|
if e != nil {
|
|
|
err = errors.New("GetMfyxWxOpenIdByMobileList, Err: " + e.Error())
|
|
|
return err
|
|
@@ -1185,12 +1147,12 @@ func SendPermissionApplyTemplateMsgAdminByYxCategory(req models.ApplyTryReq, com
|
|
|
for _, v := range openIdList {
|
|
|
openIdArr = append(openIdArr, v.OpenId)
|
|
|
}
|
|
|
- detail, e := models.GetCygxApplyRecordByMobile(mobile)
|
|
|
+ detail, e := models.GetCygxApplyRecordByMobile(usermobile)
|
|
|
if e != nil {
|
|
|
- err = errors.New("GetActivitySignupNomeetingCountList" + e.Error())
|
|
|
+ err = errors.New("GetCygxApplyRecordByMobile" + e.Error())
|
|
|
return
|
|
|
}
|
|
|
- redirectUrl := ""
|
|
|
+ //redirectUrl := ""
|
|
|
//如果是潜在客户就推送可查看详情的模版消息
|
|
|
if detail.ApplyMethod == 2 {
|
|
|
redirectUrl = utils.WX_MSG_PATH_APPLY_DETAIL + strconv.Itoa(detail.ApplyRecordId)
|