|
@@ -25,6 +25,16 @@ type NewIndex struct {
|
|
}
|
|
}
|
|
|
|
|
|
var entServerTransferMap map[string]map[bool]string
|
|
var entServerTransferMap map[string]map[bool]string
|
|
|
|
+var BiddingTypeUrl = map[int]string{
|
|
|
|
+ 1: "/list/stype/ZBYG.html",
|
|
|
|
+ 2: "/list/stype/ZBJG.html",
|
|
|
|
+ 3: "/list/stype/CGYX.html",
|
|
|
|
+ 6: "/list/stype/XMFB.html",
|
|
|
|
+ 13: "/list/rmxm/",
|
|
|
|
+ 14: "/list/xxxm/",
|
|
|
|
+ 15: "/list/gjxm/",
|
|
|
|
+ 16: "/list/sjxm/",
|
|
|
|
+}
|
|
|
|
|
|
func init() {
|
|
func init() {
|
|
xweb.AddAction(&NewIndex{})
|
|
xweb.AddAction(&NewIndex{})
|
|
@@ -62,18 +72,37 @@ func (nIndex *NewIndex) NewIndex() error {
|
|
"more": fmt.Sprintf("%s%s", config.Sysconfig["webdomain"].(string), "/list/stype/ZBGG.html"),
|
|
"more": fmt.Sprintf("%s%s", config.Sysconfig["webdomain"].(string), "/list/stype/ZBGG.html"),
|
|
}
|
|
}
|
|
//推荐标讯专区
|
|
//推荐标讯专区
|
|
- rangeInfoType := []int{1, 2, 3, 4}
|
|
|
|
- //recommendBid
|
|
|
|
|
|
+ rangeInfoType := []int{1, 2, 3}
|
|
|
|
+ //招标动态
|
|
|
|
+ bidTrends := []map[string]interface{}{}
|
|
for _, v := range rangeInfoType { //1招标预告 2 中标成交 3采购意向 4 拟建项目
|
|
for _, v := range rangeInfoType { //1招标预告 2 中标成交 3采购意向 4 拟建项目
|
|
- nIndex.T[fmt.Sprintf("recommendBid_%d", v)] = GetRecommendBidZone(v, 8)
|
|
|
|
|
|
+ listData, types := GetRecommendBidZone(v, 5)
|
|
|
|
+ bidTrends = append(bidTrends, map[string]interface{}{
|
|
|
|
+ "listData": listData,
|
|
|
|
+ "types": types,
|
|
|
|
+ "url": fmt.Sprintf("%s%s", common.ObjToString(config.Sysconfig["webdomain"]), BiddingTypeUrl[v]),
|
|
|
|
+ })
|
|
}
|
|
}
|
|
//项目分包
|
|
//项目分包
|
|
- nIndex.T["projectPackage"] = GetIndexProjectList(6, 8)
|
|
|
|
|
|
+ projectPage, typesName := GetIndexProjectList(6, 5)
|
|
|
|
+ bidTrends = append(bidTrends, map[string]interface{}{
|
|
|
|
+ "listData": projectPage,
|
|
|
|
+ "types": typesName,
|
|
|
|
+ "url": fmt.Sprintf("%s%s", common.ObjToString(config.Sysconfig["webdomain"]), BiddingTypeUrl[6]),
|
|
|
|
+ })
|
|
|
|
+ nIndex.T["bidTrends"] = bidTrends
|
|
//项目专区
|
|
//项目专区
|
|
projectZoneType := []int{13, 14, 15, 16}
|
|
projectZoneType := []int{13, 14, 15, 16}
|
|
|
|
+ projectZone := []map[string]interface{}{}
|
|
for _, val := range projectZoneType {
|
|
for _, val := range projectZoneType {
|
|
- nIndex.T[fmt.Sprintf("projectZone_%d", val)] = GetIndexProjectList(val, 8)
|
|
|
|
|
|
+ listData, types := GetIndexProjectList(val, 5)
|
|
|
|
+ projectZone = append(projectZone, map[string]interface{}{
|
|
|
|
+ "listData": listData,
|
|
|
|
+ "types": types,
|
|
|
|
+ "url": fmt.Sprintf("%s%s", common.ObjToString(config.Sysconfig["webdomain"]), BiddingTypeUrl[val]),
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
+ nIndex.T["projectZone"] = projectZone
|
|
//中标喜报
|
|
//中标喜报
|
|
nIndex.T["winnerGlad"] = WinnerGladTidings()
|
|
nIndex.T["winnerGlad"] = WinnerGladTidings()
|
|
//热门行业 ////重点招标
|
|
//热门行业 ////重点招标
|
|
@@ -163,51 +192,54 @@ func GetAreaNav() []map[string]interface{} {
|
|
}
|
|
}
|
|
|
|
|
|
// 推荐标讯专区
|
|
// 推荐标讯专区
|
|
-func GetRecommendBidZone(typ int, pageSize int) (list []map[string]interface{}) {
|
|
|
|
|
|
+func GetRecommendBidZone(typ int, pageSize int) (list []map[string]interface{}, typs string) {
|
|
if typ == 0 {
|
|
if typ == 0 {
|
|
typ = 1
|
|
typ = 1
|
|
}
|
|
}
|
|
- rediskey := fmt.Sprintf("pcindex_RecommendBidZone_%d", typ)
|
|
|
|
|
|
+ rediskey := fmt.Sprintf("pcIndexRecommendBidZone_%d", typ)
|
|
subtype := ""
|
|
subtype := ""
|
|
switch typ {
|
|
switch typ {
|
|
case 1:
|
|
case 1:
|
|
//招标预告
|
|
//招标预告
|
|
subtype = "预告"
|
|
subtype = "预告"
|
|
|
|
+ typs = "招标预告"
|
|
case 2:
|
|
case 2:
|
|
//招标中标成交
|
|
//招标中标成交
|
|
subtype = "中标,成交"
|
|
subtype = "中标,成交"
|
|
|
|
+ typs = "中标成交"
|
|
case 3:
|
|
case 3:
|
|
//采购意向
|
|
//采购意向
|
|
subtype = "采购意向"
|
|
subtype = "采购意向"
|
|
|
|
+ typs = "采购意向"
|
|
case 4:
|
|
case 4:
|
|
- //项目分包
|
|
|
|
|
|
+ //拟建
|
|
subtype = "拟建"
|
|
subtype = "拟建"
|
|
|
|
+ typs = "拟建项目"
|
|
}
|
|
}
|
|
if l, ok := redis.Get("newother", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
if l, ok := redis.Get("newother", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
|
|
list = common.ObjArrToMapArr(l)
|
|
list = common.ObjArrToMapArr(l)
|
|
} else {
|
|
} else {
|
|
_, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", subtype, "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", pageSize, "")
|
|
_, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", subtype, "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", pageSize, "")
|
|
- if lists != nil && len(*lists) > 5 {
|
|
|
|
- *lists = (*lists)[0:8]
|
|
|
|
|
|
+ if lists != nil && len(*lists) >= 5 {
|
|
|
|
+ *lists = (*lists)[0:5]
|
|
for _, v := range *lists {
|
|
for _, v := range *lists {
|
|
- // v["_id"] = EncodeArticleId2ByCheck(v["_id"].(string))
|
|
|
|
v["_id"] = encrypt.CommonEncodeArticle("indexcontent", v["_id"].(string))
|
|
v["_id"] = encrypt.CommonEncodeArticle("indexcontent", v["_id"].(string))
|
|
delete(v, "toptype")
|
|
delete(v, "toptype")
|
|
delete(v, "s_subscopeclass")
|
|
delete(v, "s_subscopeclass")
|
|
tmpdate := v["publishtime"]
|
|
tmpdate := v["publishtime"]
|
|
- v["publishtime"] = time.Unix(common.Int64All(tmpdate.(float64)), 0).Format("2006-01-02")
|
|
|
|
- if v["budget"] != nil {
|
|
|
|
- v["budget"] = ConversionMoeny(v["budget"])
|
|
|
|
- } else if v["bidamount"] != nil {
|
|
|
|
- v["budget"] = ConversionMoeny(v["bidamount"])
|
|
|
|
- }
|
|
|
|
|
|
+ v["publish_time"] = time.Unix(common.Int64All(tmpdate.(float64)), 0).Format("2006-01-02")
|
|
|
|
+ /*if v["budget"] != nil {
|
|
|
|
+ v["budget"] = ConversionMoeny(v["budget"])
|
|
|
|
+ } else if v["bidamount"] != nil {
|
|
|
|
+ v["budget"] = ConversionMoeny(v["bidamount"])
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
|
|
|
|
list = *lists
|
|
list = *lists
|
|
redis.Put("other", rediskey, list, 2*60*60)
|
|
redis.Put("other", rediskey, list, 2*60*60)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return list
|
|
|
|
|
|
+ return list, typs
|
|
}
|
|
}
|
|
|
|
|
|
// GetStrategyList 招投标攻略
|
|
// GetStrategyList 招投标攻略
|
|
@@ -228,7 +260,19 @@ func GetStrategyList() (strategyList []map[string]interface{}) {
|
|
return strategyList
|
|
return strategyList
|
|
}
|
|
}
|
|
|
|
|
|
-func GetIndexProjectList(typ, pageSize int) (data []map[string]interface{}) {
|
|
|
|
|
|
+func GetIndexProjectList(typ, pageSize int) (data []map[string]interface{}, types string) {
|
|
|
|
+ switch typ {
|
|
|
|
+ case 6:
|
|
|
|
+ types = "项目分包"
|
|
|
|
+ case 13:
|
|
|
|
+ types = "热门项目"
|
|
|
|
+ case 14:
|
|
|
|
+ types = "新兴项目"
|
|
|
|
+ case 15:
|
|
|
|
+ types = "国家级项目"
|
|
|
|
+ case 16:
|
|
|
|
+ types = "省级项目"
|
|
|
|
+ }
|
|
redidKey := fmt.Sprintf("pcIndexProjectZone_%d", typ)
|
|
redidKey := fmt.Sprintf("pcIndexProjectZone_%d", typ)
|
|
redisArr, _ := redis.Get("newother", redidKey).([]interface{})
|
|
redisArr, _ := redis.Get("newother", redidKey).([]interface{})
|
|
if len(redisArr) > 0 {
|
|
if len(redisArr) > 0 {
|
|
@@ -237,14 +281,14 @@ func GetIndexProjectList(typ, pageSize int) (data []map[string]interface{}) {
|
|
}
|
|
}
|
|
res, err := g.DB().Query(gctx.New(), fmt.Sprintf(`SELECT nbl.bid_id as bid_id,nbl.title as title,nbl.publish_time as publish_time FROM jyseo_test.new_bid_sign nbs LEFT JOIN jyseo_test.new_bidList nbl ON nbs.bid_id = nbl.bid_id WHERE bitmapContains(sign, %d) ORDER BY publish_time DESC LIMIT %d `, typ, pageSize))
|
|
res, err := g.DB().Query(gctx.New(), fmt.Sprintf(`SELECT nbl.bid_id as bid_id,nbl.title as title,nbl.publish_time as publish_time FROM jyseo_test.new_bid_sign nbs LEFT JOIN jyseo_test.new_bidList nbl ON nbs.bid_id = nbl.bid_id WHERE bitmapContains(sign, %d) ORDER BY publish_time DESC LIMIT %d `, typ, pageSize))
|
|
if err != nil || res.IsEmpty() {
|
|
if err != nil || res.IsEmpty() {
|
|
- return nil
|
|
|
|
|
|
+ return nil, types
|
|
}
|
|
}
|
|
for _, v := range res.List() {
|
|
for _, v := range res.List() {
|
|
v["bid_id"] = encrypt.EncodeArticleId2ByCheck(common.InterfaceToStr(v["bid_id"]))
|
|
v["bid_id"] = encrypt.EncodeArticleId2ByCheck(common.InterfaceToStr(v["bid_id"]))
|
|
v["publish_time"] = time.Unix(common.Int64All(v["publish_time"]), 0).Format("2006-01-02")
|
|
v["publish_time"] = time.Unix(common.Int64All(v["publish_time"]), 0).Format("2006-01-02")
|
|
data = append(data, v)
|
|
data = append(data, v)
|
|
}
|
|
}
|
|
- return data
|
|
|
|
|
|
+ return data, types
|
|
}
|
|
}
|
|
|
|
|
|
// 优秀供应商
|
|
// 优秀供应商
|