|
@@ -395,17 +395,22 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- mapHistroyArticleId := make(map[int]int)
|
|
|
+
|
|
|
|
|
|
- if userId > 0 {
|
|
|
- listArticleHistory, e := models.GetUserToArticleHistory(userId, articleIdArr)
|
|
|
- if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
- err = errors.New("获取产业关联的视频失败,GetindustryVideo " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- for _, v := range listArticleHistory {
|
|
|
- mapHistroyArticleId[v.ArticleId] = v.ArticleId
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ articleList, err := models.GetReportIndustrialReadNumList(userId, industrialIdArr)
|
|
|
+ mapHistroyindustrialId := make(map[int]int)
|
|
|
+ for _, v := range articleList {
|
|
|
+ mapHistroyindustrialId[v.IndustrialManagementId] = v.ReadNum
|
|
|
}
|
|
|
nowTime := time.Now().Local()
|
|
|
threeMonBefore := nowTime.AddDate(0, -3, 0)
|
|
@@ -413,7 +418,8 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
|
list[k].UpdateTime = utils.TimeRemoveHms(mapUPdateTime[v.IndustrialManagementId])
|
|
|
if userId > 0 {
|
|
|
|
|
|
- if mapHistroyArticleId[v.ArticleId] == 0 && user.CreatedTime.Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) {
|
|
|
+
|
|
|
+ if mapHistroyindustrialId[v.IndustrialManagementId] == 0 && user.CreatedTime.Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) {
|
|
|
list[k].IsRed = true
|
|
|
}
|
|
|
} else {
|
|
@@ -426,7 +432,7 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
|
list[k].UpdateTime = utils.TimeRemoveHms(mapUPdateTime[v.IndustrialManagementId])
|
|
|
if userId > 0 {
|
|
|
|
|
|
- if mapHistroyArticleId[v.ArticleId] == 0 && user.CreatedTime.Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) {
|
|
|
+ if mapHistroyindustrialId[v.IndustrialManagementId] == 0 && user.CreatedTime.Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(mapUPdateTime[v.IndustrialManagementId])) {
|
|
|
list[k].IsRed = true
|
|
|
}
|
|
|
} else {
|