|
@@ -530,7 +530,7 @@ func (this *UserController) ApplyTryOut() {
|
|
|
req.RealName = user.RealName
|
|
|
req.CompanyName = user.CompanyName
|
|
|
}
|
|
|
- go services.SendPermissionApplyTemplateMsg(req.RealName, req.CompanyName, mobile, applyMethod, openIpItem)
|
|
|
+ //go services.SendPermissionApplyTemplateMsg(req.RealName, req.CompanyName, mobile, applyMethod, openIpItem)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -561,10 +561,8 @@ func (this *UserController) ApplyTryOut() {
|
|
|
// utils.FileLog.Info("推送消息 %s %s,%s,%s,%s", req.RealName, req.CompanyName, mobile, openIpItem.OpenId, applyMethod)
|
|
|
// go services.SendPermissionApplyTemplateMsg(req.RealName, req.CompanyName, mobile, applyMethod, openIpItem)
|
|
|
//}
|
|
|
- //如果对应销售不存在就给王芳,汪洋推模版消息
|
|
|
- if sellerItem == nil {
|
|
|
- go services.SendPermissionApplyTemplateMsgAdmin(req, mobile, applyMethod, isResearch)
|
|
|
- }
|
|
|
+
|
|
|
+ //go services.SendPermissionApplyTemplateMsgAdmin(req, mobile, applyMethod, isResearch)
|
|
|
|
|
|
item := new(models.CygxApplyRecord)
|
|
|
item.UserId = user.UserId
|
|
@@ -583,6 +581,21 @@ func (this *UserController) ApplyTryOut() {
|
|
|
}
|
|
|
item.RegisterPlatform = utils.REGISTER_PLATFORM
|
|
|
err = models.AddApplyRecord(item)
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "申请失败"
|
|
|
+ br.ErrMsg = "申请失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if sellerItem == nil {
|
|
|
+ go services.SendPermissionApplyTemplateMsgAdmin(req, mobile, applyMethod, isResearch)
|
|
|
+ } else {
|
|
|
+ openIpItem, _ := models.GetUserRecordByMobile(4, sellerItem.Mobile)
|
|
|
+ if openIpItem != nil && openIpItem.OpenId != "" {
|
|
|
+ go services.SendPermissionApplyTemplateMsg(req.RealName, req.CompanyName, mobile, applyMethod, openIpItem)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//添加成功后,设置5分钟缓存,不允许重复添加
|
|
|
//utils.Rc.SetNX(cacheKey, user.Mobile, time.Second*60)
|
|
|
|