|
@@ -99,26 +99,39 @@ func (c *CurrentUser) PhoneIsOccupy(userId, phone string) (bool, int) {
|
|
|
}
|
|
|
} else if qutil.IntAll((*user)["i_appid"]) == 2 {
|
|
|
//查询是否绑定过微信号
|
|
|
- if MQFW.Count("user", map[string]interface{}{"i_appid": 2, "s_m_phone": phone}) > 0 {
|
|
|
- return true, 2 //已经绑定过
|
|
|
- //i_appid:2,i_type:{$ne:1},"$or":[{s_m_openid:{$exists:1}},{a_m_openid:{$exists:1}}]
|
|
|
- } else if MQFW.Count("user", map[string]interface{}{
|
|
|
- "i_appid": 2,
|
|
|
- "s_phone": phone,
|
|
|
- "i_type": map[string]interface{}{"$ne": 1},
|
|
|
+ //if MQFW.Count("user", map[string]interface{}{"i_appid": 2, "s_m_phone": phone}) > 0 {
|
|
|
+ // return true, 2 //已经绑定过
|
|
|
+ // //i_appid:2,i_type:{$ne:1},"$or":[{s_m_openid:{$exists:1}},{a_m_openid:{$exists:1}}]
|
|
|
+ //} else if MQFW.Count("user", map[string]interface{}{
|
|
|
+ // "i_appid": 2,
|
|
|
+ // "s_phone": phone,
|
|
|
+ // "i_type": map[string]interface{}{"$ne": 1},
|
|
|
+ // "$or": []map[string]interface{}{
|
|
|
+ // map[string]interface{}{
|
|
|
+ // "s_m_openid": map[string]interface{}{"$exists": 1},
|
|
|
+ // },
|
|
|
+ // map[string]interface{}{
|
|
|
+ // "a_m_openid": map[string]interface{}{"$exists": 1},
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ //}) > 0 {
|
|
|
+ // return true, 2 //被占用
|
|
|
+ //} else {
|
|
|
+ // return false, 2
|
|
|
+ //}
|
|
|
+ if MQFW.Count("user", map[string]interface{}{"i_appid": 2,
|
|
|
"$or": []map[string]interface{}{
|
|
|
map[string]interface{}{
|
|
|
- "s_m_openid": map[string]interface{}{"$exists": 1},
|
|
|
+ "s_m_phone": phone,
|
|
|
},
|
|
|
map[string]interface{}{
|
|
|
- "a_m_openid": map[string]interface{}{"$exists": 1},
|
|
|
+ "s_phone": phone,
|
|
|
},
|
|
|
},
|
|
|
}) > 0 {
|
|
|
- return true, 2 //被占用
|
|
|
- } else {
|
|
|
- return false, 2
|
|
|
+ return true, 2
|
|
|
}
|
|
|
+ return false, 2
|
|
|
} else {
|
|
|
return true, -1
|
|
|
}
|