|
@@ -122,7 +122,7 @@ func BindWxUser(openid, mobile, email, code string, bindType, areaNum, registerP
|
|
|
|
|
|
// bindWxUser 用户注册/绑定
|
|
|
func bindWxUser(openid, mobile, email string, areaNum, registerPlatform int) (userInfo UserInfo, errMsg string, err error) {
|
|
|
- source := int8(utils.USER_RECORD_CREATE_PLATFORM) //绑定来源,1:微信端,2:pc网页端,3:查研观向小程序,4:每日咨询
|
|
|
+ source := int8(utils.USER_RECORD_PLATFORM_YB) //绑定来源,1:微信端,2:pc网页端,3:查研观向小程序,4:每日咨询
|
|
|
if mobile == "" && email == "" {
|
|
|
err = errors.New("手机号或邮箱必填一个")
|
|
|
return
|
|
@@ -222,7 +222,7 @@ func bindWxUser(openid, mobile, email string, areaNum, registerPlatform int) (us
|
|
|
// 未绑定
|
|
|
if userRecord.UserID == 0 {
|
|
|
// 校验该手机号/邮箱是否已绑定过微信, 若已绑定过则所有微信均进行解绑, 仅绑定当前微信
|
|
|
- repeats, e := user_record.GetRepeatBindAccount(bindAccount, utils.USER_RECORD_CREATE_PLATFORM)
|
|
|
+ repeats, e := user_record.GetRepeatBindAccount(bindAccount, userRecord.UnionID)
|
|
|
if e != nil {
|
|
|
err = fmt.Errorf("获取重复的绑定账号数失败, err: %s", e.Error())
|
|
|
errMsg = "绑定异常"
|
|
@@ -230,7 +230,7 @@ func bindWxUser(openid, mobile, email string, areaNum, registerPlatform int) (us
|
|
|
}
|
|
|
if len(repeats) > 0 {
|
|
|
// 清除绑定关系
|
|
|
- if e = user_record.ClearRepeatBindAccount(bindAccount, utils.USER_RECORD_CREATE_PLATFORM); e != nil {
|
|
|
+ if e = user_record.ClearRepeatBindAccount(bindAccount, userRecord.UnionID); e != nil {
|
|
|
err = fmt.Errorf("重置重复的绑定账号失败, err: %s", e.Error())
|
|
|
errMsg = "绑定异常"
|
|
|
return
|