Эх сурвалжийг харах

邮箱推送是否展示添加

WH01243 2 жил өмнө
parent
commit
bc3dc0887a

+ 17 - 17
jyBXSubscribe/rpc/model/service/pushSet.go

@@ -128,6 +128,7 @@ func (this *PushSetService) Find() map[string]*bxsubscribe.PushSet {
 func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp, ShowWx bool) (bool, *bxsubscribe.PushSet) {
 	data := common.ObjToMap(in)
 	a_times := []string{}
+	isMailShow := int64(1)
 	if !(data == nil || len(*data) == 0) {
 		if (*data)["a_times"] != nil {
 			a_times = common.ObjArrToStringArr((*data)["a_times"].([]interface{}))
@@ -232,7 +233,7 @@ func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp, ShowWx
 		}
 	case "o_week_report", "o_month_report":
 		if powerData.Vip.Status > 0 || power[10] {
-			isMailShow := int64(0)
+
 			if power[10] {
 				isMailShow = int64(1)
 			}
@@ -242,34 +243,33 @@ func pushSetMontage(in interface{}, name string, powerData *pb.CheckResp, ShowWx
 				a_times = append(a_times, "每月推送 (28日 09:00)")
 			}
 			IsWxShow := int64(0)
-			if powerData.Vip.Status > 0 {
-				IsWxShow = int64(1)
+			if powerData.Vip.Status <= 0 {
+				IsWxShow = int64(0)
 			}
 			if data == nil || len(*data) == 0 {
 				returnData = &bxsubscribe.PushSet{
-					ATimes:     a_times,
-					IApppush:   1,
-					IWxpush:    common.Int64All(common.If(ShowWx, 1, 0)),
-					IMailpush:  0,
-					IRatemode:  3,
-					IsWxShow:   IsWxShow,
-					IsMailShow: isMailShow,
+					ATimes:    a_times,
+					IApppush:  1,
+					IWxpush:   common.Int64All(common.If(ShowWx, 1, 0)),
+					IMailpush: 0,
+					IRatemode: 3,
+					IsWxShow:  IsWxShow,
 				}
 			} else {
 				returnData = &bxsubscribe.PushSet{
-					ATimes:     a_times,
-					IApppush:   common.Int64All(common.If((*data)["i_apppush"] == nil, 1, (*data)["i_apppush"])),
-					IWxpush:    common.Int64All(common.If((*data)["i_wxpush"] == nil, common.If(ShowWx, 1, 0), common.If(ShowWx, (*data)["i_wxpush"], 0))),
-					IMailpush:  common.Int64All(common.If((*data)["i_mailpush"] == nil, 0, (*data)["i_mailpush"])),
-					IRatemode:  3,
-					IsWxShow:   IsWxShow,
-					IsMailShow: isMailShow,
+					ATimes:    a_times,
+					IApppush:  common.Int64All(common.If((*data)["i_apppush"] == nil, 1, (*data)["i_apppush"])),
+					IWxpush:   common.Int64All(common.If((*data)["i_wxpush"] == nil, common.If(ShowWx, 1, 0), common.If(ShowWx, (*data)["i_wxpush"], 0))),
+					IMailpush: common.Int64All(common.If((*data)["i_mailpush"] == nil, 0, (*data)["i_mailpush"])),
+					IRatemode: 3,
+					IsWxShow:  IsWxShow,
 				}
 			}
 		} else {
 			return false, nil
 		}
 	}
+	returnData.IsMailShow = isMailShow
 	return true, returnData
 
 }