Jianghan 1 year ago
parent
commit
537be1e7d7
1 changed files with 7 additions and 7 deletions
  1. 7 7
      jyBXSubscribe/rpc/model/push.go

+ 7 - 7
jyBXSubscribe/rpc/model/push.go

@@ -2250,17 +2250,17 @@ func (s *subscribePush) SubRecList(userId string, keyword []ViewKeyWord) (hasNex
 		if ids, ok := (*infos)[0]["infoids"].([]interface{}); ok && len(ids) > 0 {
 			length := len(ids)
 			resultList = make([]*bxsubscribe.SubscribeInfo, length)
-			for i, id := range ids {
-				info, b := IC.MgoBidding.FindOneByField("bidding", bson.M{"autoid": id}, bidField)
-				if b && info != nil && len(*info) > 0 {
-					title := strings.Replace(common.ObjToString((*info)["title"]), " ", "", -1)
+			binfo, _ := IC.MgoBidding.Find("bidding", bson.M{"autoid": bson.M{"$in": ids}}, `{"publishtime": -1}`, bidField, false, -1, -1)
+			if binfo != nil && len(*binfo) > 0 {
+				for i, m := range *binfo {
+					title := strings.Replace(common.ObjToString(m["title"]), " ", "", -1)
 					matchkeys := getKeys(title, keyword)
 					resultList[i] = s.InfoFormat(&PushCa{
-						InfoId:     mongodb.BsonIdToSId((*info)["_id"]),
+						InfoId:     mongodb.BsonIdToSId(m["_id"]),
 						Date:       time.Now().Unix(),
 						Keys:       matchkeys,
-						FileExists: (*info)["filetext"] != nil,
-					}, info, false)
+						FileExists: m["filetext"] != nil,
+					}, &m, false)
 				}
 			}
 			total = int64(len(resultList))