wcj 5 years ago
parent
commit
e4f62e0597
2 changed files with 10 additions and 10 deletions
  1. 7 7
      common/src/qfw/util/jy/entnichepush.go
  2. 3 3
      common/src/qfw/util/jy/subscribepush.go

+ 7 - 7
common/src/qfw/util/jy/entnichepush.go

@@ -241,12 +241,12 @@ func (e *entnichePush) GetInfoByIds(MQFW mg.MongodbSim, pushCas []*PushCa) []*Su
 	return array
 }
 
-func (e *entnichePush) Visit(PushMysql *mysql.Mysql, userId, id string) {
-	if id == "" || userId == "" {
+func (e *entnichePush) Visit(PushMysql *mysql.Mysql, userId, id int) {
+	if id <= 0 {
 		return
 	}
-	PushMysql.UpdateOrDeleteBySql("update pushsubscribe set isvisit=1 where userid='" + userId + "' and id=" + id)
-	todaySubPush, err := SubscribePush.GetTodayCache(userId)
+	PushMysql.UpdateOrDeleteBySql("update pushsubscribe set isvisit=1 where userid=? and id=?", userId, id)
+	todaySubPush, err := e.GetTodayCache(userId)
 	if err == nil && todaySubPush != nil {
 		for _, v := range todaySubPush.Datas {
 			if v.Ca_index == Int64All(id) {
@@ -254,10 +254,10 @@ func (e *entnichePush) Visit(PushMysql *mysql.Mysql, userId, id string) {
 				break
 			}
 		}
-		SubscribePush.PutTodayCache(userId, todaySubPush)
+		e.PutTodayCache(userId, todaySubPush)
 	}
 	//
-	allSubPush, err := SubscribePush.GetAllCache(userId)
+	allSubPush, err := e.GetAllCache(userId)
 	if err == nil && allSubPush != nil {
 		for _, v := range allSubPush {
 			if v.Ca_index == Int64All(id) {
@@ -265,7 +265,7 @@ func (e *entnichePush) Visit(PushMysql *mysql.Mysql, userId, id string) {
 				break
 			}
 		}
-		SubscribePush.PutAllCache(userId, allSubPush)
+		e.PutAllCache(userId, allSubPush)
 	}
 }
 

+ 3 - 3
common/src/qfw/util/jy/subscribepush.go

@@ -436,11 +436,11 @@ func (s *subscribePush) UserInfo(MQFW mg.MongodbSim, userId string) (*map[string
 	}
 	return user, Int64All((*user)["l_firstpushtime"])
 }
-func (s *subscribePush) Visit(PushMysql *mysql.Mysql, userId, id string) {
-	if id == "" || userId == "" {
+func (s *subscribePush) Visit(PushMysql *mysql.Mysql, userId string, id int) {
+	if userId == "" {
 		return
 	}
-	PushMysql.UpdateOrDeleteBySql("update pushsubscribe set isvisit=1 where userid='" + userId + "' and id=" + id)
+	PushMysql.UpdateOrDeleteBySql("update pushsubscribe set isvisit=1 where userid=? and id=?", userId, id)
 	todaySubPush, err := s.GetTodayCache(userId)
 	if err == nil && todaySubPush != nil {
 		for _, v := range todaySubPush.Datas {