|
@@ -31,17 +31,27 @@ func (l *UserInfoLogic) UserInfo(in *bxsubscribe.GetUserInfoReq) (*bxsubscribe.G
|
|
|
if in.PositionType == 0 {
|
|
|
userInfoList, _ = IC.Mgo.Find(util.USER, map[string]interface{}{"userid": in.UserId}, nil, `{"o_pushset.s_email":1","s_unionid":1}`, false, -1, -1)
|
|
|
} else {
|
|
|
- userInfoList, _ = IC.Mgo.Find(util.ENTUSER, map[string]interface{}{"entId": in.EntId, "user_id": in.EntUserId}, nil, `{"o_pushset.s_email":1","s_unionid":1}`, false, -1, -1)
|
|
|
+ userInfoList, _ = IC.Mgo.Find(util.ENTUSER, map[string]interface{}{"entId": in.EntId, "user_id": in.EntUserId}, nil, `{"o_pushset.s_email":1"}`, false, -1, -1)
|
|
|
}
|
|
|
+
|
|
|
if userInfoList != nil && len(*userInfoList) > 0 {
|
|
|
+ //微信是否关注处理
|
|
|
+ subscribeList := &[]map[string]interface{}{}
|
|
|
+ subscribeList, _ = IC.Mgo.Find(util.SUBSCRIBE, map[string]interface{}{"s_m_openid": (*userInfoList)[0]["s_m_openid"]}, `{"l_date":-1}`, `{"s_event":1"}`, true, -1, -1)
|
|
|
+ ShowWx := false
|
|
|
+ if subscribeList != nil && len(*subscribeList) > 0 {
|
|
|
+ s_event := common.ObjToString((*subscribeList)[0]["s_event"])
|
|
|
+ if s_event == "subscribe" {
|
|
|
+ ShowWx = true
|
|
|
+ }
|
|
|
+ }
|
|
|
return &bxsubscribe.GetUserInfoResq{
|
|
|
Data: &bxsubscribe.GetUserInfo{
|
|
|
Mail: common.InterfaceToStr((*userInfoList)[0]["s_email"]),
|
|
|
- ShowWx: common.InterfaceToStr((*userInfoList)[0]["s_unionid"]) != "",
|
|
|
+ ShowWx: ShowWx,
|
|
|
},
|
|
|
}, nil
|
|
|
} else {
|
|
|
return &bxsubscribe.GetUserInfoResq{}, nil
|
|
|
}
|
|
|
-
|
|
|
}
|