Эх сурвалжийг харах

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

renjiaojiao 1 жил өмнө
parent
commit
9778652fb6
1 өөрчлөгдсөн 11 нэмэгдсэн , 10 устгасан
  1. 11 10
      src/jfw/front/index.go

+ 11 - 10
src/jfw/front/index.go

@@ -303,7 +303,7 @@ func GetRecommendBidZone(typ int, pageSize int) (list []map[string]interface{},
 
 // GetStrategyList 招投标攻略
 func GetStrategyList() (strategyList []map[string]interface{}) {
-	if l, ok := redis.Get("newother", "pcIndexStrategyList").([]interface{}); ok && l != nil && len(l) > 0 {
+	if l, ok := redis.Get(RedisNameNew, "pcIndexStrategyList").([]interface{}); ok && l != nil && len(l) > 0 {
 		strategyList = common.ObjArrToMapArr(l)
 	} else {
 		for _, item := range jySchool.GuidelineColumn().SeedData {
@@ -333,7 +333,7 @@ func GetIndexProjectList(typ, pageSize int) (data []map[string]interface{}, type
 		types = "省级项目"
 	}
 	redidKey := fmt.Sprintf("pcIndexProjectZone_%d", typ)
-	redisArr, _ := redis.Get("newother", redidKey).([]interface{})
+	redisArr, _ := redis.Get(RedisNameNew, redidKey).([]interface{})
 	if len(redisArr) > 0 {
 		data = common.ObjArrToMapArr(redisArr)
 		return
@@ -347,30 +347,31 @@ func GetIndexProjectList(typ, pageSize int) (data []map[string]interface{}, type
 		v["publish_time"] = time.Unix(common.Int64All(v["publish_time"]), 0).Format("2006-01-02")
 		data = append(data, v)
 	}
+	redis.Put(RedisNameNew, redidKey, data, 24*3600)
 	return data, types
 }
 
 // 优秀供应商
 func GetBidInfoPublishEnt() (res [][]map[string]interface{}) {
-	if l, ok := redis.Get("newother", "pcIndexBidInfoGoodPublishEnt").([]interface{}); ok && l != nil && len(l) > 0 {
+	if l, ok := redis.Get(RedisNameNew, "pcIndexBidInfoGoodPublishEnt").([]interface{}); ok && l != nil && len(l) > 0 {
 		for _, v := range l {
 			res = append(res, common.ObjArrToMapArr(v.([]interface{})))
 		}
 
 	} else {
-		data := public.Mysql.Find("entniche_info", map[string]interface{}{"auth_status": 1}, "id,name", "auth_time DESC", -1, -1)
+		data := public.Mysql.Query("SELECT id,name FROM `entniche_info` WHERE auth_status = 1 ORDER BY auth_startTime DESC")
 		if data != nil && len(*data) > 0 {
 			entData := []map[string]interface{}{}
-			if len(*data) > 60 {
-				r := rand.Intn(len(*data) - 60)
-				entData = (*data)[r : r+60]
+			if len(*data) > 150 {
+				r := rand.Intn(len(*data) - 150)
+				entData = (*data)[r : r+150]
 			} else {
 				entData = *data
 			}
 			if len(entData) > 0 {
 				once := []map[string]interface{}{}
 				for _, val := range entData {
-					if len(once) <= 15 {
+					if len(once) <= 14 {
 						once = append(once, val)
 					} else {
 						res = append(res, once)
@@ -382,7 +383,7 @@ func GetBidInfoPublishEnt() (res [][]map[string]interface{}) {
 					res = append(res, once)
 				}
 			}
-			redis.Put("newother", "pcIndexBidInfoGoodPublishEnt", res, 3600*24*7)
+			redis.Put(RedisNameNew, "pcIndexBidInfoGoodPublishEnt", res, 24*3600)
 		}
 	}
 	return res
@@ -399,6 +400,6 @@ func GetImportBidding() []*hotKeyWord {
 	}
 	randomNumber := rand.Intn(len(subjectMatter) - 30)
 	res := subjectMatter[randomNumber : randomNumber+30]
-	redis.Put(RedisNameNew, "pcIndexImportBidding", res, 3600*6)
+	redis.Put(RedisNameNew, "pcIndexImportBidding", res, 24*3600)
 	return res
 }