Explorar o código

Merge branch 'dev/v4.8.83_rjj' of qmx/jy into feature/v4.8.83

renjiaojiao hai 1 ano
pai
achega
65bbc87505

+ 8 - 7
src/jfw/front/index.go

@@ -203,14 +203,14 @@ func (nIndex *NewIndex) NewIndex() error {
 		})
 	}
 	//采购意向
-	procure, procureName := GetIndexProjectList(5, 5)
+	procure, procureName := GetIndexProjectList(5, 10)
 	bidTrends = append(bidTrends, map[string]interface{}{
 		"listData": procure,
 		"types":    procureName,
 		"url":      fmt.Sprintf("%s", BiddingTypeUrl[5]),
 	})
 	//项目分包
-	projectPage, typesName := GetIndexProjectList(6, 5)
+	projectPage, typesName := GetIndexProjectList(6, 10)
 	bidTrends = append(bidTrends, map[string]interface{}{
 		"listData": projectPage,
 		"types":    typesName,
@@ -221,7 +221,7 @@ func (nIndex *NewIndex) NewIndex() error {
 	projectZoneType := []int{13, 14, 15, 16}
 	projectZone := []map[string]interface{}{}
 	for _, val := range projectZoneType {
-		listData, types := GetIndexProjectList(val, 5)
+		listData, types := GetIndexProjectList(val, 10)
 		projectZone = append(projectZone, map[string]interface{}{
 			"listData": listData,
 			"types":    types,
@@ -383,17 +383,18 @@ func GetIndexProjectList(typ, pageSize int) (data []map[string]interface{}, type
 		data = common.ObjArrToMapArr(redisArr)
 		return
 	}
-	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 new_bid_sign nbs  LEFT JOIN 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 bid_id,publish_time,bitmapToArray(sign) FROM new_bid_sign WHERE bitmapContains(sign, %d) ORDER BY publish_time DESC LIMIT %d`, typ, pageSize))
 	if err != nil || res.IsEmpty() {
 		return nil, types
 	}
-	for _, v := range res.List() {
+	/*for _, v := range res.List() {
 		v["_id"] = encrypt.EncodeArticleId2ByCheck(common.InterfaceToStr(v["bid_id"]))
 		v["publish_time"] = time.Unix(common.Int64All(v["publish_time"]), 0).Format("2006-01-02")
 		data = append(data, v)
-	}
+	}*/
+	finalArr := FillingBiddingBaseFields(gctx.New(), res.List(), types)
 	redis.Put(RedisNameNew, redidKey, data, 24*3600)
-	return data, types
+	return finalArr, types
 }
 
 // 优秀供应商

+ 3 - 1
src/web/templates/pc/template/index/project-card-list-container.html

@@ -14,12 +14,14 @@
       </header>
       <main class="cms-card-content">
         <ul class="cms-card-list clearfix">
-          {{range $vv := $v.listData}}
+          {{range $kk,$vv := $v.listData}}
+          {{if lt $kk 5}}
           <li class="cms-card-list-item">
             <a class="cms-card-list-item-left cms-link ellipsis" target="_blank" title="{{$vv.title}}" href="/nologin/content/{{$vv._id}}.html" target="_blank">{{$vv.title}}</a>
             <span class="cms-card-list-item-right">{{$vv.publish_time}}</span>
           </li>
           {{end}}
+          {{end}}
         </ul>
       </main>
       <!-- <main class="cms-card-content cms-card-list empty">