|
@@ -2244,32 +2244,33 @@ func (s *SubPushQueryParam) ExportPushFormat() (ids, keyWords []string) {
|
|
// @Description clickhouse获取推荐的列表数据
|
|
// @Description clickhouse获取推荐的列表数据
|
|
// @Date 2024/3/11
|
|
// @Date 2024/3/11
|
|
func (s *subscribePush) SubRecList(userId string, keyword []ViewKeyWord) (hasNextPage bool, total int64, resultList []*bxsubscribe.SubscribeInfo) {
|
|
func (s *subscribePush) SubRecList(userId string, keyword []ViewKeyWord) (hasNextPage bool, total int64, resultList []*bxsubscribe.SubscribeInfo) {
|
|
- sql := "select bitmapToArray(infoids) infoids, userid from jianyu.sub_recommend_list where userid = ?"
|
|
|
|
- infos := IC.CkJy.SelectBySql(sql, userId)
|
|
|
|
- if infos != nil && len(*infos) > 0 {
|
|
|
|
- if ids, ok := (*infos)[0]["infoids"].([]interface{}); ok && len(ids) > 0 {
|
|
|
|
- length := len(ids)
|
|
|
|
- resultList = make([]*bxsubscribe.SubscribeInfo, length)
|
|
|
|
- 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(m["_id"]),
|
|
|
|
- Date: time.Now().Unix(),
|
|
|
|
- Keys: matchkeys,
|
|
|
|
- FileExists: m["filetext"] != nil,
|
|
|
|
- }, &m, false)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- total = int64(len(resultList))
|
|
|
|
- if total > pageSize {
|
|
|
|
- resultList = resultList[:pageSize]
|
|
|
|
- hasNextPage = true
|
|
|
|
- }
|
|
|
|
|
|
+ //sql := "select bitmapToArray(infoids) infoids, userid from jianyu.sub_recommend_list where userid = ?"
|
|
|
|
+ //infos := IC.CkJy.SelectBySql(sql, userId)
|
|
|
|
+ //if infos != nil && len(*infos) > 0 {
|
|
|
|
+ //if ids, ok := (*infos)[0]["infoids"].([]interface{}); ok && len(ids) > 0 {
|
|
|
|
+ ids := []int64{272269745, 272269067, 272268763}
|
|
|
|
+ length := len(ids)
|
|
|
|
+ resultList = make([]*bxsubscribe.SubscribeInfo, length)
|
|
|
|
+ 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(m["_id"]),
|
|
|
|
+ Date: time.Now().Unix(),
|
|
|
|
+ Keys: matchkeys,
|
|
|
|
+ FileExists: m["filetext"] != nil,
|
|
|
|
+ }, &m, false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ total = int64(len(resultList))
|
|
|
|
+ if total > pageSize {
|
|
|
|
+ resultList = resultList[:pageSize]
|
|
|
|
+ hasNextPage = true
|
|
|
|
+ }
|
|
|
|
+ //}
|
|
|
|
+ //}
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|