|
@@ -58,7 +58,7 @@ func dealBidding() {
|
|
|
now := time.Now()
|
|
|
ctx, _ := context.WithTimeout(context.Background(), 99999*time.Hour)
|
|
|
coll := sess.M.C.Database(GF.MongoB.DB).Collection(GF.MongoB.Coll)
|
|
|
- find := options.Find().SetBatchSize(1000).SetSort(bson.D{bson.E{"comeintime", 1}}).SetProjection(bson.M{"comeintime": 1, "toptype": 1, "subtype": 1, "buyerclass": 1, "title": 1, "detail": 1, "package": 1, "funds": 1, "spidercode": 1})
|
|
|
+ find := options.Find().SetBatchSize(1000).SetSort(bson.D{bson.E{"comeintime", 1}}).SetProjection(bson.M{"comeintime": 1, "toptype": 1, "subtype": 1, "buyerclass": 1, "title": 1, "detail": 1, "package": 1, "funds": 1, "spidercode": 1, "area": 1, "city": 1, "publishtime": 1})
|
|
|
if startTime != 0 && GF.Cron.End != 0 {
|
|
|
q = map[string]interface{}{
|
|
|
"comeintime": map[string]interface{}{
|
|
@@ -126,6 +126,18 @@ func dealBidding() {
|
|
|
"nav_column": reb,
|
|
|
}},
|
|
|
}
|
|
|
+
|
|
|
+ // 改动栏目的数据,存储临时表;刷存量数据使用
|
|
|
+ //if util.IntAll(rea["项目分包"]) == 1 || util.IntAll(rea["省级项目"]) == 1 {
|
|
|
+ // insert := map[string]interface{}{
|
|
|
+ // "bid_id": mongodb.BsonIdToSId(tmp["_id"]),
|
|
|
+ // "area": tmp["area"],
|
|
|
+ // "city": tmp["city"],
|
|
|
+ // "publishtime": time.Unix(util.Int64All(tmp["publishtime"]), 0).Format("2006-01-02 15:04:05"),
|
|
|
+ // "nav_column": reb,
|
|
|
+ // }
|
|
|
+ // MgoB.InsertOrUpdate(MgoB.DbName, "wcc_column_tmp", insert)
|
|
|
+ //}
|
|
|
//MgoB.Update(GF.MongoB.Coll, where, map[string]interface{}{"$set": update}, true, false)
|
|
|
}
|
|
|
}(tmp)
|
|
@@ -141,6 +153,7 @@ func dealBidding() {
|
|
|
|
|
|
//处理热门标讯数据/热门项目
|
|
|
getHot()
|
|
|
+ //dealHotDataAll()
|
|
|
|
|
|
log.Info("dealBidding", zap.Int("over ", count))
|
|
|
}
|
|
@@ -360,3 +373,28 @@ func updateMethod() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// dealHotDataAll 处理存量热门数据标签
|
|
|
+func dealHotDataAll() {
|
|
|
+ hotData, _ := MgoB.Find("bidding_hots", nil, nil, nil, false, -1, -1)
|
|
|
+ for _, data := range *hotData {
|
|
|
+ biddingID := util.ObjToString(data["bidding_id"])
|
|
|
+ bidding, _ := MgoB.FindById("bidding", biddingID, nil)
|
|
|
+ biddingData := *bidding
|
|
|
+ if biddingData == nil {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ biddingData["hot_data"] = 1
|
|
|
+ rea := TagBidding(biddingData)
|
|
|
+ reb := calculateFlag(rea, columns) //拿到十进制数字,标签栏目结果
|
|
|
+
|
|
|
+ updatePool <- []map[string]interface{}{
|
|
|
+ {"_id": mongodb.StringTOBsonId(biddingID)},
|
|
|
+ {"$set": bson.M{
|
|
|
+ "nav_column": reb,
|
|
|
+ }},
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ log.Info("dealHotDataAll", zap.Int("over", len(*hotData)))
|
|
|
+}
|