|
@@ -182,7 +182,7 @@ func (c *CurrentUser) PhoneIsOccupy(userId, phone string) (bool, int, string) {
|
|
|
if unionId == "" {
|
|
|
return true, 2, ""
|
|
|
}
|
|
|
- exists, relationPhoneId := jy.NewPhoneUtil(MQFW).BindPhoneIsOccupy(unionId, phone)
|
|
|
+ exists, relationPhoneId := jy.NewPhoneUtil(MQFW).BindPhoneIsOccupy(userId, unionId, phone)
|
|
|
if !exists {
|
|
|
return false, 2, relationPhoneId
|
|
|
}
|
|
@@ -194,22 +194,22 @@ func (c *CurrentUser) PhoneIsOccupy(userId, phone string) (bool, int, string) {
|
|
|
|
|
|
//绑定手机号
|
|
|
func (c *CurrentUser) BindPhone(userId, phone, email string) (bool, int) {
|
|
|
- isOccupy, appid, _ := c.PhoneIsOccupy(userId, phone)
|
|
|
- if isOccupy {
|
|
|
- return false, appid
|
|
|
- }
|
|
|
- if appid == 2 {
|
|
|
- //商机管理绑定手机号需要和剑鱼保持一致,建立双向绑定关系
|
|
|
- //err := jy.NewPhoneUtil(MQFW).BindPhone(userId, relationPhoneId, phone, email, nil)\
|
|
|
- var err error
|
|
|
- if err == nil {
|
|
|
- return true, appid
|
|
|
- }
|
|
|
- return false, appid
|
|
|
- }
|
|
|
- return MQFW.UpdateById("user", userId, map[string]interface{}{
|
|
|
- "$set": map[string]interface{}{"s_m_phone": phone},
|
|
|
- }), appid
|
|
|
+ isOccupy, appid, _ := c.PhoneIsOccupy(userId, phone)
|
|
|
+ if isOccupy {
|
|
|
+ return false, appid
|
|
|
+ }
|
|
|
+ if appid == 2 {
|
|
|
+ //商机管理绑定手机号需要和剑鱼保持一致,建立双向绑定关系
|
|
|
+ //err := jy.NewPhoneUtil(MQFW).BindPhone(userId, relationPhoneId, phone, email, nil)\
|
|
|
+ var err error
|
|
|
+ if err == nil {
|
|
|
+ return true, appid
|
|
|
+ }
|
|
|
+ return false, appid
|
|
|
+ }
|
|
|
+ return MQFW.UpdateById("user", userId, map[string]interface{}{
|
|
|
+ "$set": map[string]interface{}{"s_m_phone": phone},
|
|
|
+ }), appid
|
|
|
}
|
|
|
|
|
|
//更换手机号
|