|
@@ -2,6 +2,7 @@ package controllers
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
"hongze/hongze_cygx/models"
|
|
|
"hongze/hongze_cygx/services"
|
|
|
"hongze/hongze_cygx/utils"
|
|
@@ -855,20 +856,26 @@ func (this *UserController) ApplyTryOut() {
|
|
|
if mobile == "" {
|
|
|
mobile = user.Email
|
|
|
}
|
|
|
- applyMethod := ""
|
|
|
- if req.ApplyMethod == 1 {
|
|
|
- applyMethod = "已有客户申请"
|
|
|
- } else {
|
|
|
- applyMethod = "潜在客户申请"
|
|
|
- }
|
|
|
- cnf, _ := models.GetConfigByCode("tpl_msg")
|
|
|
- if cnf != nil {
|
|
|
- openIpItem, _ := models.GetUserRecordByUserId(user.UserId, 1)
|
|
|
- if openIpItem != nil && openIpItem.OpenId != "" {
|
|
|
- go services.SendPermissionApplyTemplateMsg(user.RealName, sellerItem.CompanyName, mobile, openIpItem.OpenId, applyMethod)
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ applyMethod := ""
|
|
|
+ if req.ApplyMethod == 1 {
|
|
|
+ applyMethod = "已有客户申请"
|
|
|
+ } else {
|
|
|
+ applyMethod = "潜在客户申请"
|
|
|
+ }
|
|
|
+ cnf, _ := models.GetConfigByCode("tpl_msg")
|
|
|
+ fmt.Println("cnf", cnf)
|
|
|
+ if cnf != nil {
|
|
|
+ openIpItem, _ := models.GetUserRecordByUserId(user.UserId, 1)
|
|
|
+ fmt.Println("openIpItem", openIpItem)
|
|
|
+ fmt.Println("OpenId", openIpItem.OpenId)
|
|
|
+ if openIpItem != nil && openIpItem.OpenId != "" {
|
|
|
+ fmt.Println("send:", user.RealName, user.CompanyName, mobile, openIpItem.OpenId, applyMethod)
|
|
|
+ go services.SendPermissionApplyTemplateMsg(user.RealName, user.CompanyName, mobile, openIpItem.OpenId, applyMethod)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
err = models.AddApplyRecord(&req, user.Mobile, user.CompanyName, user.UserId, user.CompanyId)
|
|
|
if err != nil {
|
|
|
br.Msg = "申请失败"
|