|
@@ -171,16 +171,16 @@ func (s *Short) Article(stype, id string) error {
|
|
ssOpenid := s.Session().Get("s_m_openid")
|
|
ssOpenid := s.Session().Get("s_m_openid")
|
|
var res *map[string]interface{}
|
|
var res *map[string]interface{}
|
|
if userId == "" && ssOpenid != "" {
|
|
if userId == "" && ssOpenid != "" {
|
|
- res, _ = mongodb.FindOneByField("user", bson.M{"s_m_openid": ssOpenid, "s_unionid": bson.M{"$ne": ssOpenid}}, nil)
|
|
|
|
|
|
+ res, _ = mongodb.FindOneByField("user", bson.M{"s_m_openid": ssOpenid, "s_unionid": bson.M{"$ne": ssOpenid}}, `{"i_vip_status":1,"i_member_status":1,"s_m_phone":1,"s_phone":1}`)
|
|
userId = BsonIdToSId((*res)["_id"])
|
|
userId = BsonIdToSId((*res)["_id"])
|
|
} else {
|
|
} else {
|
|
//判断用户是否是vip
|
|
//判断用户是否是vip
|
|
- res, _ = public.MQFW.FindById("user", userId, nil)
|
|
|
|
|
|
+ res, _ = public.MQFW.FindById("user", userId, `{"i_vip_status":1,"i_member_status":1,"s_m_phone":1,"s_phone":1}`)
|
|
}
|
|
}
|
|
isVip, isMember, isEntniche := false, false, false
|
|
isVip, isMember, isEntniche := false, false, false
|
|
|
|
|
|
isVip = util.IntAll((*res)["i_vip_status"]) == 1 || util.IntAll((*res)["i_vip_status"]) == 2
|
|
isVip = util.IntAll((*res)["i_vip_status"]) == 1 || util.IntAll((*res)["i_vip_status"]) == 2
|
|
- isMember = util.IntAll((*res)["i_vip_status"]) > 0
|
|
|
|
|
|
+ isMember = util.IntAll((*res)["i_member_status"]) > 0
|
|
|
|
|
|
if phone, _ := util.If(util.ObjToString((*res)["s_phone"]) != "", util.ObjToString((*res)["s_phone"]), util.ObjToString((*res)["s_m_phone"])).(string); phone != "" {
|
|
if phone, _ := util.If(util.ObjToString((*res)["s_phone"]) != "", util.ObjToString((*res)["s_phone"]), util.ObjToString((*res)["s_m_phone"])).(string); phone != "" {
|
|
isEntniche = public.Mysql.CountBySql(`SELECT count(1) from entniche_user a INNER JOIN entniche_info b on (a.phone=? and a.power=1 and a.ent_id=b.id and b.status>0)`, phone) > 0
|
|
isEntniche = public.Mysql.CountBySql(`SELECT count(1) from entniche_user a INNER JOIN entniche_info b on (a.phone=? and a.power=1 and a.ent_id=b.id and b.status>0)`, phone) > 0
|
|
@@ -250,12 +250,17 @@ func (s *Short) Article(stype, id string) error {
|
|
if ssOpenid != nil {
|
|
if ssOpenid != nil {
|
|
obj["ucbsId"] = util.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
|
|
obj["ucbsId"] = util.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
|
|
}
|
|
}
|
|
- if isVip || isMember || isEntniche {
|
|
|
|
- if obj["winnertel"] == nil && isbid(obj["subtype"]) {
|
|
|
|
- obj["winner_enttel"] = getwinnertel(obj["winner"])
|
|
|
|
|
|
+
|
|
|
|
+ if obj["winnertel"] == nil && isbid(obj["subtype"]) {
|
|
|
|
+ obj["winner_enttel"] = getwinnertel(obj["winner"])
|
|
|
|
+ }
|
|
|
|
+ if !(isVip || isMember || isEntniche) { //非会员不展示电话字段
|
|
|
|
+ if obj["winnertel"] != nil {
|
|
|
|
+ obj["winnertel"] = "无权限"
|
|
|
|
+ }
|
|
|
|
+ if obj["winner_enttel"] != nil {
|
|
|
|
+ obj["winner_enttel"] = "无权限"
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- delete(obj, "winnertel")
|
|
|
|
}
|
|
}
|
|
|
|
|
|
s.T["obj"] = obj
|
|
s.T["obj"] = obj
|
|
@@ -319,12 +324,16 @@ func (s *Short) Article(stype, id string) error {
|
|
if ssOpenid != nil {
|
|
if ssOpenid != nil {
|
|
obj["ucbsId"] = util.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
|
|
obj["ucbsId"] = util.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
|
|
}
|
|
}
|
|
- if isVip || isEntniche || isMember {
|
|
|
|
- if obj["winnertel"] == nil && isbid(obj["subtype"]) {
|
|
|
|
- obj["winner_enttel"] = getwinnertel(obj["winner"])
|
|
|
|
|
|
+ if obj["winnertel"] == nil && isbid(obj["subtype"]) {
|
|
|
|
+ obj["winner_enttel"] = getwinnertel(obj["winner"])
|
|
|
|
+ }
|
|
|
|
+ if !(isVip || isMember || isEntniche) { //非会员不展示电话字段
|
|
|
|
+ if obj["winnertel"] != nil {
|
|
|
|
+ obj["winnertel"] = "无权限"
|
|
|
|
+ }
|
|
|
|
+ if obj["winner_enttel"] != nil {
|
|
|
|
+ obj["winner_enttel"] = "无权限"
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- delete(obj, "winnertel")
|
|
|
|
}
|
|
}
|
|
s.T["obj"] = obj
|
|
s.T["obj"] = obj
|
|
if obj["projectname"] != nil {
|
|
if obj["projectname"] != nil {
|