|
@@ -12,6 +12,9 @@ import (
|
|
|
func CheckHtgj(companyCodeHt, companyNameHt, email, sign string) (errMsg string, errHt error, user *models.WxUser, companyName string) {
|
|
|
errMsg = CheckSign(companyCodeHt+companyNameHt+email, sign)
|
|
|
if errMsg != "" {
|
|
|
+ if errMsg == "机构下账号个数已达上限" {
|
|
|
+ return
|
|
|
+ }
|
|
|
errMsg = "签名方式错误!"
|
|
|
return
|
|
|
}
|
|
@@ -202,6 +205,16 @@ func CheckHtgj(companyCodeHt, companyNameHt, email, sign string) (errMsg string,
|
|
|
}
|
|
|
countUser, err := models.GetUserCountByThirdName(int(companyId), wxuUserName)
|
|
|
if countUser == 0 {
|
|
|
+
|
|
|
+ countCompanyUser, err := models.GetUserCountByThirdName(int(companyId), wxuUserName)
|
|
|
+ if err != nil {
|
|
|
+ errHt = err
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if countCompanyUser >= 15 {
|
|
|
+ errMsg = "机构下账号个数已达上限"
|
|
|
+ return
|
|
|
+ }
|
|
|
wxUser.CompanyId = int(companyId)
|
|
|
wxUser.RealName = wxuUserName
|
|
|
wxUser.Email = wxuUserName
|