|
@@ -51,51 +51,52 @@ func (this *PushSetService) Update(item, setType, pushType string, ratemode, pus
|
|
|
return update
|
|
|
}
|
|
|
func (this *PushSetService) Find() map[string]*bxsubscribe.PushSet {
|
|
|
- pushSetList := &map[string]interface{}{}
|
|
|
+ pushSetMap := &map[string]interface{}{}
|
|
|
if this.PositionType == 0 {
|
|
|
- pushSetList, _ = IC.Mgo.FindById(util.USER, this.UserId, `{"o_pushset":":1}`)
|
|
|
+ pushSetMap, _ = IC.Mgo.FindById(util.USER, this.UserId, `{"o_pushset":":1}`)
|
|
|
} else {
|
|
|
- pushSetList, _ = IC.Mgo.FindOne(util.ENTUSER, map[string]interface{}{"i_entid": this.EntId, "i_userid": this.EntUserId})
|
|
|
+ pushSetMap, _ = IC.Mgo.FindOne(util.ENTUSER, map[string]interface{}{"i_entid": this.EntId, "i_userid": this.EntUserId})
|
|
|
}
|
|
|
pushSet := map[string]*bxsubscribe.PushSet{}
|
|
|
//用户权益获取
|
|
|
powerData := IC.Middleground.PowerCheckCenter.Check("10000", this.UserId, this.BaseUserId, this.AccountId, this.EntId, this.PositionType, this.PositionId)
|
|
|
- if pushSetList != nil && len(*pushSetList) > 0 {
|
|
|
- o_pushset, _ := (*pushSetList)["o_pushset"].(map[string]interface{})
|
|
|
- if o_pushset != nil {
|
|
|
- pushSet["interested"] = &bxsubscribe.PushSet{
|
|
|
- Interested: common.Int64All(o_pushset["i_interested"]),
|
|
|
- }
|
|
|
- }
|
|
|
- fool, o_subset := pushSetMontage(o_pushset["o_subset"], "o_subset", powerData)
|
|
|
- if fool {
|
|
|
- pushSet["o_subset"] = o_subset
|
|
|
- }
|
|
|
- fool, o_week_report := pushSetMontage(o_pushset["o_week_report"], "o_week_report", powerData)
|
|
|
- if fool {
|
|
|
- pushSet["o_week_report"] = o_week_report
|
|
|
- }
|
|
|
- fool, o_month_report := pushSetMontage(o_pushset["o_month_report"], "o_month_report", powerData)
|
|
|
- if fool {
|
|
|
- pushSet["o_month_report"] = o_month_report
|
|
|
- }
|
|
|
- fool, o_newproject_forecast := pushSetMontage(o_pushset["o_newproject_forecast"], "o_newproject_forecast", powerData)
|
|
|
- if fool {
|
|
|
- pushSet["o_newproject_forecast"] = o_newproject_forecast
|
|
|
- }
|
|
|
- fool, o_entinfo := pushSetMontage(o_pushset["o_entinfo"], "o_entinfo", powerData)
|
|
|
- if fool {
|
|
|
- pushSet["o_entinfo"] = o_entinfo
|
|
|
- }
|
|
|
- fool, o_follow_project := pushSetMontage(o_pushset["o_follow_project"], "o_follow_project", powerData)
|
|
|
- if fool {
|
|
|
- pushSet["o_follow_project"] = o_follow_project
|
|
|
- }
|
|
|
- fool, o_follow_ent := pushSetMontage(o_pushset["o_follow_ent"], "o_follow_ent", powerData)
|
|
|
- if fool {
|
|
|
- pushSet["o_follow_ent"] = o_follow_ent
|
|
|
+ o_pushset := map[string]interface{}{}
|
|
|
+ if pushSetMap != nil && len(*pushSetMap) > 0 {
|
|
|
+ o_pushset, _ = (*pushSetMap)["o_pushset"].(map[string]interface{})
|
|
|
+ }
|
|
|
+ if o_pushset != nil {
|
|
|
+ pushSet["interested"] = &bxsubscribe.PushSet{
|
|
|
+ Interested: common.Int64All(o_pushset["i_interested"]),
|
|
|
}
|
|
|
}
|
|
|
+ fool, o_subset := pushSetMontage(o_pushset["o_subset"], "o_subset", powerData)
|
|
|
+ if fool {
|
|
|
+ pushSet["o_subset"] = o_subset
|
|
|
+ }
|
|
|
+ fool, o_week_report := pushSetMontage(o_pushset["o_week_report"], "o_week_report", powerData)
|
|
|
+ if fool {
|
|
|
+ pushSet["o_week_report"] = o_week_report
|
|
|
+ }
|
|
|
+ fool, o_month_report := pushSetMontage(o_pushset["o_month_report"], "o_month_report", powerData)
|
|
|
+ if fool {
|
|
|
+ pushSet["o_month_report"] = o_month_report
|
|
|
+ }
|
|
|
+ fool, o_newproject_forecast := pushSetMontage(o_pushset["o_newproject_forecast"], "o_newproject_forecast", powerData)
|
|
|
+ if fool {
|
|
|
+ pushSet["o_newproject_forecast"] = o_newproject_forecast
|
|
|
+ }
|
|
|
+ fool, o_entinfo := pushSetMontage(o_pushset["o_entinfo"], "o_entinfo", powerData)
|
|
|
+ if fool {
|
|
|
+ pushSet["o_entinfo"] = o_entinfo
|
|
|
+ }
|
|
|
+ fool, o_follow_project := pushSetMontage(o_pushset["o_follow_project"], "o_follow_project", powerData)
|
|
|
+ if fool {
|
|
|
+ pushSet["o_follow_project"] = o_follow_project
|
|
|
+ }
|
|
|
+ fool, o_follow_ent := pushSetMontage(o_pushset["o_follow_ent"], "o_follow_ent", powerData)
|
|
|
+ if fool {
|
|
|
+ pushSet["o_follow_ent"] = o_follow_ent
|
|
|
+ }
|
|
|
return pushSet
|
|
|
}
|
|
|
func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp) (bool, *bxsubscribe.PushSet) {
|