Browse Source

no message

xingzai 2 years ago
parent
commit
1e4c8fe788
3 changed files with 16 additions and 12 deletions
  1. 5 1
      services/activity.go
  2. 10 10
      services/activity_special.go
  3. 1 1
      services/article.go

+ 5 - 1
services/activity.go

@@ -1596,6 +1596,10 @@ func GetActivityNewLabelMap(activityIds []int) (labelMap map[int]bool, industryN
 	//		}
 	//	}
 	//}
+
+	for k := range activityIds {
+		labelMap[k] = true
+	}
 	//产业关联的弘则报告发布日期在三个月以内的活动、产业显示 NEW标签
 	articNewLabel, e := GetArticNewLabelWhithActivity3Month()
 	if e != nil {
@@ -1603,7 +1607,7 @@ func GetActivityNewLabelMap(activityIds []int) (labelMap map[int]bool, industryN
 		return
 	}
 	for k := range articNewLabel {
-		labelMap[k] = true
+		labelMap[k] = false
 	}
 
 	return

+ 10 - 10
services/activity_special.go

@@ -125,17 +125,17 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, isPower int, chartPerm
 	if err != nil {
 		return
 	}
-	if len(specialList) < 8 {
-		conditionTrip += ` AND art.days = 0  ORDER BY art.last_updated_time DESC`
-		specialListNotrip, e := models.GetActivityLabelSpecialListAll(condition, pars, 0, 8-len(specialList))
-		if e != nil {
-			err = e
-			return
-		}
-		for _, v := range specialListNotrip {
-			specialList = append(specialList, v)
-		}
+	//if len(specialList) < 8 {
+	//	conditionTrip += ` AND art.days = 0  ORDER BY art.last_updated_time DESC`
+	specialListNotrip, e := models.GetActivityLabelSpecialListAll(condition, pars, 0, 20)
+	if e != nil {
+		err = e
+		return
+	}
+	for _, v := range specialListNotrip {
+		specialList = append(specialList, v)
 	}
+	//}
 	for k2, v2 := range specialList {
 		specialList[k2].KeyWord = LabelStrV5(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
 		specialList[k2].ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220426202204/20220426/XDLLsjC9XAAy8LIzQr7GsjrBbtX6.png"

+ 1 - 1
services/article.go

@@ -1597,7 +1597,7 @@ func GetSpecialArticleDetailUserPower(user *models.WxUserItem, articleInfo *mode
 func GetArticNewLabelWhithActivity3Month() (labelMap map[int]bool, err error) {
 	var condition string
 	var pars []interface{}
-	condition += ` AND publish_date  >= ?  AND article_id < ? `
+	condition += ` AND publish_date  <= ?  AND article_id < ? `
 	pars = append(pars, time.Now().AddDate(0, -3, 0), utils.SummaryArticleId)
 	articleList, e := models.GetArticleList(condition, pars)
 	if e != nil {