|
@@ -56,9 +56,12 @@ func (w *WeekMonthPush) GetUserInfo(m map[string]interface{}) *UserInfo {
|
|
|
vipStatus := util.IntAll(m["vipstatus"])
|
|
|
memberStatus := util.IntAll(m["memberstatus"])
|
|
|
nicheStatus := util.IntAll(m["nichestatus"])
|
|
|
+ if nicheStatus == 1 && (EntUsers[userId] == nil || EntUsers[userId].Power == 0) {
|
|
|
+ logger.Info("不是商机管理", entName, entId, userId)
|
|
|
+ return nil
|
|
|
+ }
|
|
|
sess := Mgo.GetMgoConn()
|
|
|
defer Mgo.DestoryMongoConn(sess)
|
|
|
-<<<<<<< HEAD
|
|
|
var eu map[string]interface{}
|
|
|
sess.DB(DbConf.Mongodb.Main.DbName).C(Mgo_Ent_User).Find(map[string]interface{}{
|
|
|
"i_userid": userId,
|
|
@@ -70,71 +73,11 @@ func (w *WeekMonthPush) GetUserInfo(m map[string]interface{}) *UserInfo {
|
|
|
if eu == nil || len(eu) == 0 {
|
|
|
logger.Info("没有找到用户", entName, entId, userId)
|
|
|
return nil
|
|
|
- }
|
|
|
- if (vipStatus == 1 && util.IntAll(eu["i_vip_status"]) <= 0) || (memberStatus == 1 && util.IntAll(eu["i_member_status"]) <= 0) {
|
|
|
+ } else if (vipStatus == 1 && util.IntAll(eu["i_vip_status"]) <= 0) || (memberStatus == 1 && util.IntAll(eu["i_member_status"]) <= 0) {
|
|
|
logger.Info("超级订阅/大会员已到期", entName, entId, userId)
|
|
|
return nil
|
|
|
}
|
|
|
pushSet, _ := eu["o_pushset"].(map[string]interface{})
|
|
|
-=======
|
|
|
- if vipStatus == 1 || memberStatus == 1 {
|
|
|
- var eu map[string]interface{}
|
|
|
- sess.DB(DbConf.Mongodb.Main.DbName).C(Mgo_Ent_User).Find(map[string]interface{}{
|
|
|
- "i_userid": userId,
|
|
|
- }).Select(map[string]interface{}{
|
|
|
- "i_vip_status": 1,
|
|
|
- "i_member_status": 1,
|
|
|
- }).One(&eu)
|
|
|
- if eu == nil || len(eu) == 0 {
|
|
|
- logger.Info("没有找到用户", entName, entId, userId)
|
|
|
- return nil
|
|
|
- }
|
|
|
- if (vipStatus == 1 && util.IntAll(eu["i_vip_status"]) <= 0) || (memberStatus == 1 && util.IntAll(eu["i_member_status"]) <= 0) {
|
|
|
- logger.Info("超级订阅/大会员已到期", entName, entId, userId)
|
|
|
- return nil
|
|
|
- }
|
|
|
- } else if nicheStatus == 1 {
|
|
|
- if EntUsers[userId] == nil || EntUsers[userId].Power == 0 {
|
|
|
- logger.Info("不是商机管理", entName, entId, userId)
|
|
|
- return nil
|
|
|
- }
|
|
|
- } else {
|
|
|
- return nil
|
|
|
- }
|
|
|
- var u map[string]interface{}
|
|
|
- var uis UisSortByRateMode
|
|
|
- var query map[string]interface{}
|
|
|
- if isDis == 1 {
|
|
|
- query = map[string]interface{}{
|
|
|
- "i_entid": entId,
|
|
|
- "i_userid": 0,
|
|
|
- }
|
|
|
- } else if vipStatus == 1 || memberStatus == 1 {
|
|
|
- query = map[string]interface{}{
|
|
|
- "i_type": 1,
|
|
|
- "i_userid": userId,
|
|
|
- }
|
|
|
- } else if nicheStatus == 1 {
|
|
|
- query = map[string]interface{}{
|
|
|
- "i_type": 0,
|
|
|
- "i_userid": userId,
|
|
|
- }
|
|
|
- } else {
|
|
|
- return nil
|
|
|
- }
|
|
|
- sess.DB(DbConf.Mongodb.Main.DbName).C(Entniche_rule).Find(query).Select(map[string]interface{}{
|
|
|
- "o_entniche.i_ratemode": 1,
|
|
|
- "o_entniche.i_apppush": 1,
|
|
|
- "o_entniche.i_mailpush": 1,
|
|
|
- "o_entniche.s_email": 1,
|
|
|
- "o_entniche.i_wxpush": 1,
|
|
|
- }).One(&u)
|
|
|
- if u == nil || len(u) == 0 {
|
|
|
- logger.Info(query, "没有找到该订阅设置", entName, entId, userId)
|
|
|
- return nil
|
|
|
- }
|
|
|
- o_entniche, _ := u["o_entniche"].(map[string]interface{})
|
|
|
->>>>>>> master
|
|
|
rule := &UserInfo{
|
|
|
Entniche: &Entniche{
|
|
|
EntId: entId,
|
|
@@ -145,26 +88,10 @@ func (w *WeekMonthPush) GetUserInfo(m map[string]interface{}) *UserInfo {
|
|
|
Id: util.ObjToString(m["mid"]),
|
|
|
MemberStatus: memberStatus,
|
|
|
VipStatus: vipStatus,
|
|
|
-<<<<<<< HEAD
|
|
|
SubSet: &SubSet{},
|
|
|
}
|
|
|
rule.GetPushSet(pushSet)
|
|
|
uis := MyNewUserInfo(Mgo, rule)
|
|
|
-=======
|
|
|
- NicheStatus: nicheStatus,
|
|
|
- SubSet: &SubSet{
|
|
|
- WxPush: util.IntAllDef(o_entniche["i_wxpush"], 1),
|
|
|
- AppPush: util.IntAllDef(o_entniche["i_apppush"], 1),
|
|
|
- MailPush: util.IntAll(o_entniche["i_mailpush"]),
|
|
|
- RateMode: util.IntAllDef(o_entniche["i_ratemode"], 2),
|
|
|
- Email: util.ObjToString(o_entniche["s_email"]),
|
|
|
- },
|
|
|
- }
|
|
|
- if EntUsers[userId] != nil {
|
|
|
- rule.Entniche.Mail = EntUsers[userId].Mail
|
|
|
- }
|
|
|
- uis = NewUserInfo(Mgo, rule)
|
|
|
->>>>>>> master
|
|
|
if uis == nil || len(uis) == 0 {
|
|
|
return nil
|
|
|
}
|