浏览代码

Merge branch 'cygx_9.2' into debug

ziwen 2 年之前
父节点
当前提交
83e1e00c24
共有 1 个文件被更改,包括 8 次插入7 次删除
  1. 8 7
      controllers/report.go

+ 8 - 7
controllers/report.go

@@ -383,15 +383,16 @@ func (this *ReportController) ArticleCategoryList() {
 			return
 		}
 		//查询用户今天是否看过时间线
-		count, err := models.GetTimeLineRecordCount(user.UserId, industrialManagementId,time.Now().Format(utils.FormatDate))
+		count, err := models.GetTimeLineRecordCount(user.UserId, industrialManagementId, time.Now().Format(utils.FormatDate))
 		for _, v := range timeLineList {
 			if v.Readnum == 0 && user.CreatedTime.Before(utils.StrTimeToTime(v.PublishTime)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(v.PublishTime)) {
-				if count == 0 {
-					timeLineItem.IsRed = true
-				}
+				timeLineItem.IsRed = true
 			}
 		}
-
+		//因为无法记录用户是否看过晨会点评,所以用用户今天是否看过时间线来判断是否显示小红点,这里是判断分类的小红点
+		if !timeLineItem.IsRed && count == 0{
+			timeLineItem.IsRed = true
+		}
 		list = append([]*models.IndustrialToArticleCategoryRep{&timeLineItem}, list...)
 	}
 
@@ -631,9 +632,9 @@ func (this *ReportController) List() {
 		//}
 
 		//查询用户今天是否看过时间线
-		count, err := models.GetTimeLineRecordCount(user.UserId, industrialManagementId,time.Now().Format(utils.FormatDate))
+		count, err := models.GetTimeLineRecordCount(user.UserId, industrialManagementId, time.Now().Format(utils.FormatDate))
 		for k, v := range list {
-			if v.Readnum == 0 && user.CreatedTime.Before(utils.StrTimeToTime(v.PublishTime)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(v.PublishTime)) {
+			if v.SubCategoryName != "时间线" && v.Readnum == 0 && user.CreatedTime.Before(utils.StrTimeToTime(v.PublishTime)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(v.PublishTime)) {
 				list[k].IsRed = true
 			}
 			if v.SubCategoryName == "时间线" && count == 0 {