Forráskód Böngészése

自测问题提交

wangkaiyue 4 éve
szülő
commit
c9a7babaf8

+ 6 - 2
src/jfw/modules/common/src/qfw/util/jy/userMerge.go

@@ -146,9 +146,13 @@ func (this *UserMerge) Merge(wId, pId, choose string, noteFunc ...func(...interf
 				}
 			}
 		}
-		if !this.mg.UpdateById("user", wId, map[string]interface{}{
+		change := map[string]interface{}{
 			"$set": upset,
-		}) {
+		}
+		if (*wxRes)["s_m_phone"] == (*wxRes)["s_phone"] { //s_m_phone和s_phone都存在 保留s_phone
+			change["$unset"] = map[string]interface{}{"s_m_phone": ""}
+		}
+		if !this.mg.UpdateById("user", wId, change) {
 			updateErr = fmt.Errorf("自动合并更新异常")
 		}
 		this.FlushSession(wxRes, "")                        //更新session

+ 3 - 3
src/jfw/modules/subscribepay/src/service/userAccountInfo.go

@@ -710,8 +710,8 @@ func mailStep(sess *httpsession.Session, step int, mail, code, doType string) (s
 
 //手机号占用查询(绑定)
 func bindPhoneIsOccupy(phone, unionid string) bool {
-	//已经绑定过
-	if util.MQFW.Count("user", map[string]interface{}{"i_appid": 2, "s_m_phone": phone}) > 0 {
+	//已经有微信账户绑定过
+	if util.MQFW.Count("user", map[string]interface{}{"i_appid": 2, "s_m_phone": phone, "s_phone": map[string]interface{}{"$exists": 0}}) > 0 {
 		return true
 	}
 	//是否存在手机号用户
@@ -719,7 +719,7 @@ func bindPhoneIsOccupy(phone, unionid string) bool {
 		"i_appid": 2,
 		"s_phone": phone,
 	}); pUserNum > 0 {
-		//存在手机号用户,但手机号未绑定微信,或绑定微信和当前账户绑定微信一致
+		//存在手机号用户,但手机号未绑定微信,或绑定微信和当前账户绑定微信一致
 		if pUserNum == 1 && pUserNum == util.MQFW.Count("user", map[string]interface{}{
 			"i_appid": 2,
 			"s_phone": phone,