Browse Source

修复 热门项目 id 重复问题

wcc 1 year ago
parent
commit
25a8c6bff3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      website_columns/main.go

+ 2 - 2
website_columns/main.go

@@ -151,10 +151,10 @@ func dealBidding() {
 func getHot() {
 	var existsMap = make(map[string]bool) //bidding_hots 已经存在的ID
 	//获取已有热门数据
-	hots, _ := MgoB.Find("bidding_hots", nil, nil, map[string]interface{}{"_id": 1}, false, -1, -1)
+	hots, _ := MgoB.Find("bidding_hots", nil, nil, map[string]interface{}{"bidding_id": 1}, false, -1, -1)
 	if len(*hots) > 0 {
 		for _, v := range *hots {
-			existsMap[mongodb.BsonIdToSId(v["_id"])] = true
+			existsMap[mongodb.BsonIdToSId(v["bidding_id"])] = true
 		}
 	}