|
@@ -57,7 +57,7 @@ func (this *PushSetService) Find() 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{})
|
|
|
- fool, o_subset := pushSetMontage(o_pushset["o_pushset"], "o_pushset", powerData)
|
|
|
+ fool, o_subset := pushSetMontage(o_pushset["o_subset"], "o_subset", powerData)
|
|
|
if fool {
|
|
|
pushSet["o_subset"] = o_subset
|
|
|
}
|
|
@@ -83,7 +83,7 @@ func (this *PushSetService) Find() map[string]*bxsubscribe.PushSet {
|
|
|
}
|
|
|
fool, o_follow_ent := pushSetMontage(o_pushset["o_follow_ent"], "o_follow_ent", powerData)
|
|
|
if fool {
|
|
|
- pushSet["o_entinfo"] = o_follow_ent
|
|
|
+ pushSet["o_follow_ent"] = o_follow_ent
|
|
|
}
|
|
|
}
|
|
|
return pushSet
|
|
@@ -91,8 +91,10 @@ func (this *PushSetService) Find() map[string]*bxsubscribe.PushSet {
|
|
|
func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp) (bool, *bxsubscribe.PushSet) {
|
|
|
data := common.ObjToMap(in)
|
|
|
a_times := []string{}
|
|
|
- if (*data)["a_times"] != nil {
|
|
|
- a_times = common.ObjArrToStringArr((*data)["a_times"].([]interface{}))
|
|
|
+ if !(data == nil || len(*data) == 0) {
|
|
|
+ if (*data)["a_times"] != nil {
|
|
|
+ a_times = common.ObjArrToStringArr((*data)["a_times"].([]interface{}))
|
|
|
+ }
|
|
|
}
|
|
|
returnData := &bxsubscribe.PushSet{}
|
|
|
switch name {
|
|
@@ -109,14 +111,14 @@ func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp) (bool,
|
|
|
} else {
|
|
|
returnData = &bxsubscribe.PushSet{
|
|
|
ATimes: a_times,
|
|
|
- IApppush: common.Int64All((*data)["i_apppush"]),
|
|
|
- IWxpush: common.Int64All((*data)["i_wxpush"]),
|
|
|
- IMailpush: common.Int64All((*data)["i_mailpush"]),
|
|
|
- IRatemode: common.Int64All((*data)["i_ratemode"]),
|
|
|
+ IApppush: common.Int64All(common.If((*data)["i_apppush"] == nil, 1, (*data)["i_apppush"])),
|
|
|
+ IWxpush: common.Int64All(common.If((*data)["i_wxpush"] == nil, 1, (*data)["i_wxpush"])),
|
|
|
+ IMailpush: common.Int64All(common.If((*data)["i_mailpush"] == nil, 0, (*data)["i_mailpush"])),
|
|
|
+ IRatemode: common.Int64All(common.If((*data)["i_ratemode"] == nil, 5, (*data)["i_ratemode"])),
|
|
|
IsWxShow: 1,
|
|
|
}
|
|
|
}
|
|
|
- case "o_follow_projec", "follow":
|
|
|
+ case "o_follow_project", "o_follow_ent":
|
|
|
if data == nil || len(*data) == 0 {
|
|
|
returnData = &bxsubscribe.PushSet{
|
|
|
ATimes: a_times,
|
|
@@ -129,14 +131,14 @@ func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp) (bool,
|
|
|
} else {
|
|
|
returnData = &bxsubscribe.PushSet{
|
|
|
ATimes: a_times,
|
|
|
- IApppush: common.Int64All((*data)["i_apppush"]),
|
|
|
- IWxpush: common.Int64All((*data)["i_wxpush"]),
|
|
|
- IMailpush: common.Int64All((*data)["i_mailpush"]),
|
|
|
+ IApppush: common.Int64All(common.If((*data)["i_apppush"] == nil, 1, (*data)["i_apppush"])),
|
|
|
+ IWxpush: common.Int64All(common.If((*data)["i_wxpush"] == nil, 1, (*data)["i_wxpush"])),
|
|
|
+ IMailpush: common.Int64All(common.If((*data)["i_mailpush"] == nil, 0, (*data)["i_mailpush"])),
|
|
|
IRatemode: 1,
|
|
|
IsWxShow: 1,
|
|
|
}
|
|
|
}
|
|
|
- case "entinfo", "o_newproject_forecast":
|
|
|
+ case "o_entinfo", "o_newproject_forecast":
|
|
|
if powerData.Member.Status > 0 {
|
|
|
if data == nil || len(*data) == 0 {
|
|
|
returnData = &bxsubscribe.PushSet{
|
|
@@ -150,9 +152,9 @@ func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp) (bool,
|
|
|
} else {
|
|
|
returnData = &bxsubscribe.PushSet{
|
|
|
ATimes: a_times,
|
|
|
- IApppush: common.Int64All((*data)["i_apppush"]),
|
|
|
- IWxpush: common.Int64All((*data)["i_wxpush"]),
|
|
|
- IMailpush: common.Int64All((*data)["i_mailpush"]),
|
|
|
+ IApppush: common.Int64All(common.If((*data)["i_apppush"] == nil, 1, (*data)["i_apppush"])),
|
|
|
+ IWxpush: common.Int64All(common.If((*data)["i_wxpush"] == nil, 1, (*data)["i_wxpush"])),
|
|
|
+ IMailpush: common.Int64All(common.If((*data)["i_mailpush"] == nil, 0, (*data)["i_mailpush"])),
|
|
|
IRatemode: 1,
|
|
|
IsWxShow: 0,
|
|
|
}
|
|
@@ -166,16 +168,16 @@ func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp) (bool,
|
|
|
power[common.IntAll(v)] = true
|
|
|
}
|
|
|
if powerData.Vip.Status > 0 || power[10] {
|
|
|
+ if name == "o_week_report" {
|
|
|
+ a_times = append(a_times, "每周推送 (周五:09:00)")
|
|
|
+ } else {
|
|
|
+ a_times = append(a_times, "每月推送 (28日09:00)")
|
|
|
+ }
|
|
|
IsWxShow := int64(0)
|
|
|
if powerData.Vip.Status > 0 {
|
|
|
IsWxShow = int64(1)
|
|
|
}
|
|
|
if data == nil || len(*data) == 0 {
|
|
|
- if name == "o_week_report" {
|
|
|
- a_times = append(a_times, "每周推送 (周五:09:00)")
|
|
|
- } else {
|
|
|
- a_times = append(a_times, "每月推送 (28日09:00)")
|
|
|
- }
|
|
|
returnData = &bxsubscribe.PushSet{
|
|
|
ATimes: a_times,
|
|
|
IApppush: 1,
|