|
@@ -19,7 +19,7 @@ import (
|
|
|
|
|
|
const (
|
|
|
query = `{"query":{"terms":{"_id":["%s"]}},"_source":["_id","subtype","s_winner","buyertel","winnertel","buyerclass"],"from":0,"size":%d}`
|
|
|
- mongodb_fields = `{"_id":1,"area":1,"publishtime":1,"s_subscopeclass":1,"subtype":1,"title":1,"toptype":1,"type":1, "buyerclass":1,"budget":1,"bidamount":1,"winnertel":1,"s_winner":1,"buyertel":1}`
|
|
|
+ mongodb_fields = `{"_id":1,"area":1,"publishtime":1,"s_subscopeclass":1,"subtype":1,"title":1,"toptype":1,"type":1, "buyerclass":1,"budget":1,"bidamount":1,"winnertel":1,"s_winner":1,"buyertel":1,"attach_text":1}`
|
|
|
querys = `{"query":{"terms":{"_id":["%s"]}},"_source":["_id","title","detail","area","city","publishtime","projectname","buyer","buyerclass","s_winner","bidamount","subtype","toptype","projectcode","buyertel","budget","bidopentime","agency","projectscope","winnerperson","winnertel"],"from":0,"size":%d}}`
|
|
|
)
|
|
|
|
|
@@ -359,6 +359,7 @@ type InfoList struct {
|
|
|
Buyer string `json:"buyer"`
|
|
|
S_winner string `json:"s_winner"`
|
|
|
Bidopentime int64 `json:"bidopentime"`
|
|
|
+ FileExists bool `json:"fileExists"`
|
|
|
}
|
|
|
|
|
|
//根据id取内容
|
|
@@ -396,6 +397,7 @@ func GetInfoById(Mgo_bidding mongodb.MongodbSim, bidding, bidding_back string, i
|
|
|
if list != nil {
|
|
|
for _, v := range *list {
|
|
|
_id := common.ObjToString(v["_id"])
|
|
|
+ v["attachment_count"] = common.If(v["filetext"] != nil, 1, 0).(int)
|
|
|
infos[_id] = v
|
|
|
}
|
|
|
}
|
|
@@ -414,6 +416,7 @@ func GetInfoById(Mgo_bidding mongodb.MongodbSim, bidding, bidding_back string, i
|
|
|
for _, v := range *list {
|
|
|
_id := mongodb.BsonIdToSId(v["_id"])
|
|
|
v["_id"] = _id
|
|
|
+ v["attachment_count"] = common.If(v["attach_text"] != nil, 1, 0).(int)
|
|
|
infos[_id] = v
|
|
|
}
|
|
|
}
|
|
@@ -431,6 +434,7 @@ func GetInfoById(Mgo_bidding mongodb.MongodbSim, bidding, bidding_back string, i
|
|
|
for _, v := range *list {
|
|
|
_id := mongodb.BsonIdToSId(v["_id"])
|
|
|
v["_id"] = _id
|
|
|
+ v["attachment_count"] = common.If(v["attach_text"] != nil, 1, 0).(int)
|
|
|
infos[_id] = v
|
|
|
}
|
|
|
}
|
|
@@ -492,6 +496,7 @@ func InfoFormat(p string, info *map[string]interface{}) *InfoList {
|
|
|
Buyer: common.ObjToString((*info)["buyer"]),
|
|
|
S_winner: common.ObjToString((*info)["s_winner"]),
|
|
|
Bidopentime: common.Int64All((*info)["bidopentime"]),
|
|
|
+ FileExists: common.IntAll((*info)["attachment_count"]) > 0,
|
|
|
}
|
|
|
}
|
|
|
|