Ver Fonte

feat:过滤

wangchuanjin há 1 ano atrás
pai
commit
5dd5ad1bc8
2 ficheiros alterados com 30 adições e 2 exclusões
  1. 15 1
      pushsubscribe/push/util/entity.go
  2. 15 1
      pushsupersub/push/util/entity.go

+ 15 - 1
pushsubscribe/push/util/entity.go

@@ -3,8 +3,10 @@ package util
 import (
 	"fmt"
 	. "pushsubscribe/push/config"
+	. "pushsubscribe/push/db"
 
 	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/redis"
 	. "bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
 )
 
@@ -16,9 +18,14 @@ func NewPushParam(dayCount int, mailPush bool, u *UserInfo, sl *SortList) *PushP
 	infos := &SortList{}
 	infosLength := 0
 	for _, ks := range *sl {
+		info := NewBiddingInfo(ks.Info, ks.Keys)
+		if u.SubPushInactive == -2 {
+			if exists, _ := redis.Exists(Pushcache_2_c, fmt.Sprintf("inactiveChange_%s_%s", u.Id, info.Id)); exists {
+				continue
+			}
+		}
 		infosLength++
 		dayCount++
-		info := NewBiddingInfo(ks.Info, ks.Keys)
 		*infos = append(*infos, ks)
 		titleArray = append(titleArray, info.AreaTitle)
 		if infosLength == 1 {
@@ -51,6 +58,13 @@ func NewPushParam(dayCount int, mailPush bool, u *UserInfo, sl *SortList) *PushP
 			break
 		}
 	}
+	if u.SubPushInactive == -2 {
+		Mgo.UpdateById(Mgo_User, u.Id, map[string]interface{}{
+			"$set": map[string]interface{}{
+				"subpush_inactive": -3,
+			},
+		})
+	}
 	return &PushParam{
 		JpushTitle:   jpushTitle,
 		LastInfoDate: lastInfoDate,

+ 15 - 1
pushsupersub/push/util/entity.go

@@ -3,8 +3,10 @@ package util
 import (
 	"fmt"
 	. "pushsupersub/push/config"
+	. "pushsupersub/push/db"
 
 	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/redis"
 	. "bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
 )
 
@@ -16,9 +18,14 @@ func NewPushParam(isLimit bool, dayCount int, mailPush bool, u *UserInfo, sl *So
 	infos := &SortList{}
 	infosLength := 0
 	for _, ks := range *sl {
+		info := NewBiddingInfo(ks.Info, ks.Keys)
+		if u.SubPushInactive == -2 {
+			if exists, _ := redis.Exists(Pushcache_2_c, fmt.Sprintf("inactiveChange_%s_%s", u.Id, info.Id)); exists {
+				continue
+			}
+		}
 		infosLength++
 		dayCount++
-		info := NewBiddingInfo(ks.Info, ks.Keys)
 		*infos = append(*infos, ks)
 		titleArray = append(titleArray, info.AreaTitle)
 		if infosLength == 1 {
@@ -51,6 +58,13 @@ func NewPushParam(isLimit bool, dayCount int, mailPush bool, u *UserInfo, sl *So
 			break
 		}
 	}
+	if u.SubPushInactive == -2 {
+		Mgo.UpdateById(Mgo_User, u.Id, map[string]interface{}{
+			"$set": map[string]interface{}{
+				"subpush_inactive": -3,
+			},
+		})
+	}
 	return &PushParam{
 		JpushTitle:   jpushTitle,
 		LastInfoDate: lastInfoDate,