Переглянути джерело

Merge branch 'develop' of 192.168.3.17:zhanghongbo/qfw into develop

wangchuanjin 9 роки тому
батько
коміт
3befb9f3de
2 змінених файлів з 11 додано та 4 видалено
  1. 9 2
      push/src/qfw/push/cache.go
  2. 2 2
      push/src/qfw/push/dopush/dopush.go

+ 9 - 2
push/src/qfw/push/cache.go

@@ -25,7 +25,7 @@ type MemberInterest struct {
 }
 
 //初始化缓存,在每次执行任务时调用,
-func InitCache(flag, m_openid string) map[string]*[]*MemberInterest {
+func InitCache(flag, m_openid string,bview bool) map[string]*[]*MemberInterest {
 	defer func() {
 		if r := recover(); r != nil {
 			log.Println("[E]", r)
@@ -42,11 +42,18 @@ func InitCache(flag, m_openid string) map[string]*[]*MemberInterest {
 	cache := make(map[string]*[]*MemberInterest)
 	q := map[string]interface{}{}
 	if m_openid != "" {
-		q = map[string]interface{}{
+		if bview{
+			q = map[string]interface{}{
+			"s_m_openid":                           m_openid,
+			}	
+		}else{
+			q = map[string]interface{}{
 			"o_msgset." + flag + ".i_switchstatus": 1,
 			"o_msgset." + flag + ".i_status":       1,
 			"s_m_openid":                           m_openid,
+			}	
 		}
+		
 	} else {
 		fixPush := util.ObjToString(PushConfig["fixPush"])
 		if len(fixPush) > 5 {

+ 2 - 2
push/src/qfw/push/dopush/dopush.go

@@ -69,7 +69,7 @@ func (p *Pjob) EachInfoForView(mopenid, words string) map[string]interface{} {
 			words: &ss,
 		}
 	} else {
-		*p.Cache = push.InitCache(p.Stype, mopenid)
+		*p.Cache = push.InitCache(p.Stype, mopenid,true)
 	}
 	p.CreateUserInterestWord()
 	session := mongodb.GetMgoConn()
@@ -171,7 +171,7 @@ func (p *Pjob) EachInfoForView(mopenid, words string) map[string]interface{} {
 func (p *Pjob) DoPush(mopenid, stime string, opr int, ltime int64) bool {
 	log.Println("开始执行任务:", p.StypeName, stime)
 	p.Cache = new(map[string]*[]*push.MemberInterest)
-	*p.Cache = push.InitCache(p.Stype, mopenid)
+	*p.Cache = push.InitCache(p.Stype, mopenid,false)
 	p.CreateUserInterestWord()
 	return EachAllBidInfo(p.Stype, "["+p.StypeName+"信息]", p.StypeName, ltime, p.MaxPushSize, p.Dfa, p.Cache, opr)
 }