|
@@ -28,8 +28,8 @@ import (
|
|
|
const (
|
|
|
pageSize = 100
|
|
|
AllSubPushCacheSize = 200
|
|
|
- query = `{"query":{"terms":{"_id":["%s"]}},"_source":["_id","area", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "type", "buyerclass","bidamount","budget","projectname","buyer","bidopentime","s_winner","filetext","buyertel","buyerperson","agency","agencyperson","agencytel","winnerperson","winnertel","signendtime","bidendtime"],"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,"s_winner":1,"bidopentime":1,"buyer":1,"projectname":1,"filetext":1,"buyertel":1,"buyerperson":1,"agency":1,"agencyperson":1,"agencytel":1,"winnerperson":1,"winnertel":1,"signendtime":1,"bidendtime":1}`
|
|
|
+ query = `{"query":{"terms":{"_id":["%s"]}},"_source":["_id","area", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "type", "buyerclass","bidamount","budget","projectname","buyer","bidopentime","s_winner","filetext","buyertel","buyerperson","agency","agencyperson","agencytel","winnerperson","winnertel","signendtime","bidendtime","entidlist"],"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,"s_winner":1,"bidopentime":1,"buyer":1,"projectname":1,"filetext":1,"buyertel":1,"buyerperson":1,"agency":1,"agencyperson":1,"agencytel":1,"winnerperson":1,"winnertel":1,"signendtime":1,"bidendtime":1,"entidlist":1}`
|
|
|
|
|
|
SubFreeFlag = "fType"
|
|
|
SubVipFlag = "vType"
|
|
@@ -235,16 +235,33 @@ func (s *subscribePush) InfoFormat(p *PushCa, info *map[string]interface{}, isPa
|
|
|
if !isPay {
|
|
|
return formatInfo
|
|
|
}
|
|
|
+ winnerList := common.InterfaceToStr((*info)["s_winner"]) //中标企业名称集合
|
|
|
+ if winnerList != "" && len(strings.Split(winnerList, ",")) > 0 {
|
|
|
+ for wk, wv := range strings.Split(winnerList, ",") {
|
|
|
+ var (
|
|
|
+ winnerId = ""
|
|
|
+ )
|
|
|
+ if (*info)["entidlist"] != nil {
|
|
|
+ if entIdList := common.ObjArrToStringArr((*info)["entidlist"].([]interface{})); len(entIdList) > wk { //中标企业id集合
|
|
|
+ winnerId = entIdList[wk]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ formatInfo.WinnerInfo = append(formatInfo.WinnerInfo, &bxsubscribe.WinnerInfo{
|
|
|
+ Winner: wv, //中标企业 需要单独处理
|
|
|
+ WinnerTel: common.ObjToString((*info)["winnertel"]), //中标企业联系电话
|
|
|
+ WinnerPerson: common.ObjToString((*info)["winnerperson"]), //中标企业联系人
|
|
|
+ WinnerId: common.If(winnerId != "" && len([]rune(winnerId)) > 12, encrypt.EncodeArticleId2ByCheck(winnerId), "").(string), //中标企业加密id 存在winnerId 异常的情况
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
// 付费用户返回详细列表字段
|
|
|
formatInfo.BuyerTel = common.ObjToString((*info)["buyertel"])
|
|
|
formatInfo.BuyerPerson = common.ObjToString((*info)["buyerperson"])
|
|
|
formatInfo.Agency = common.ObjToString((*info)["agency"])
|
|
|
formatInfo.AgencyPerson = common.ObjToString((*info)["agencyperson"])
|
|
|
formatInfo.AgencyTel = common.ObjToString((*info)["agencytel"])
|
|
|
- formatInfo.WinnerPerson = common.ObjToString((*info)["winnerperson"])
|
|
|
- formatInfo.WinnerTel = common.ObjToString((*info)["winnertel"])
|
|
|
- formatInfo.SignendTime = common.ObjToString((*info)["signendtime"])
|
|
|
- formatInfo.BidendTime = common.ObjToString((*info)["bidendtime"])
|
|
|
+ formatInfo.SignendTime = common.Int64All((*info)["signendtime"])
|
|
|
+ formatInfo.BidendTime = common.Int64All((*info)["bidendtime"])
|
|
|
return formatInfo
|
|
|
|
|
|
}
|
|
@@ -1002,7 +1019,7 @@ func GetKeySet(t string, u *map[string]interface{}, data []string) (bool, []stri
|
|
|
const (
|
|
|
INDEX = "bidding"
|
|
|
TYPE = "bidding"
|
|
|
- bidField = `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","buyerclass","budget","bidamount","filetext","spidercode","site","buyer","bidopentime","buyertel","buyerperson","agency","agencyperson","agencytel","s_winner",winnerperson","winnertel","signendtime","bidendtime"`
|
|
|
+ bidField = `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","buyerclass","budget","bidamount","filetext","spidercode","site","buyer","bidopentime","buyertel","buyerperson","agency","agencyperson","agencytel","s_winner",winnerperson","winnertel","signendtime","bidendtime","entidlist"`
|
|
|
bidTime = `{"range":{"publishtime":{"gt":%d}}}`
|
|
|
bidSort = `{"publishtime":"desc"}`
|
|
|
findfields = `"title"`
|