|
@@ -407,44 +407,44 @@ func (this *ReportController) ArticleCategoryList() {
|
|
|
return
|
|
|
}
|
|
|
//查询用户今天是否看过时间线
|
|
|
- haveMorningMeeting := false
|
|
|
- var morningMeetingTime string
|
|
|
- count, err := models.GetTimeLineRecordCount(user.UserId, industrialManagementId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "查询浏览记录数量失败"
|
|
|
- br.ErrMsg = "查询浏览记录数量失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- var recordItem *models.CygxPageHistoryRecord
|
|
|
- if count > 1 {
|
|
|
- recordItem, err = models.GetTimeLineRecordItem(user.UserId, industrialManagementId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "查询浏览记录失败"
|
|
|
- br.ErrMsg = "查询浏览记录失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
+ //haveMorningMeeting := false
|
|
|
+ //var morningMeetingTime string
|
|
|
+ //count, err := models.GetTimeLineRecordCount(user.UserId, industrialManagementId)
|
|
|
+ //if err != nil {
|
|
|
+ // br.Msg = "查询浏览记录数量失败"
|
|
|
+ // br.ErrMsg = "查询浏览记录数量失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //var recordItem *models.CygxPageHistoryRecord
|
|
|
+ //if count > 1 {
|
|
|
+ // recordItem, err = models.GetTimeLineRecordItem(user.UserId, industrialManagementId)
|
|
|
+ // if err != nil {
|
|
|
+ // br.Msg = "查询浏览记录失败"
|
|
|
+ // br.ErrMsg = "查询浏览记录失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ //}
|
|
|
|
|
|
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 v.SubCategoryName == "时间线" {
|
|
|
- haveMorningMeeting = true
|
|
|
- morningMeetingTime = v.PublishTime
|
|
|
+ //haveMorningMeeting = true
|
|
|
+ //morningMeetingTime = v.PublishTime
|
|
|
continue
|
|
|
}
|
|
|
timeLineItem.IsRed = true
|
|
|
}
|
|
|
}
|
|
|
//因为无法记录用户是否看过晨会点评,所以用用户今天是否看过时间线来判断是否显示小红点,这里是判断分类的小红点
|
|
|
- timeLineRed := false
|
|
|
- if count < 2 {
|
|
|
- timeLineRed = true
|
|
|
- } else if count > 1 && recordItem.CreateTime.Before(utils.StrTimeToTime(morningMeetingTime)) {
|
|
|
- timeLineRed = true
|
|
|
- }
|
|
|
- if !timeLineItem.IsRed && timeLineRed && haveMorningMeeting {
|
|
|
- timeLineItem.IsRed = true
|
|
|
- }
|
|
|
+ //timeLineRed := false
|
|
|
+ //if count < 2 {
|
|
|
+ // timeLineRed = true
|
|
|
+ //} else if count > 1 && recordItem.CreateTime.Before(utils.StrTimeToTime(morningMeetingTime)) {
|
|
|
+ // timeLineRed = true
|
|
|
+ //}
|
|
|
+ //if !timeLineItem.IsRed && timeLineRed && haveMorningMeeting {
|
|
|
+ // timeLineItem.IsRed = true
|
|
|
+ //}
|
|
|
list = append([]*models.IndustrialToArticleCategoryRep{&timeLineItem}, list...)
|
|
|
|
|
|
if chapterId > 0 && isSendWx == 1 {
|
|
@@ -677,35 +677,35 @@ func (this *ReportController) List() {
|
|
|
//}
|
|
|
|
|
|
//查询用户今天是否看过时间线
|
|
|
- count, err := models.GetTimeLineRecordCount(user.UserId, industrialManagementId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "查询浏览记录数量失败"
|
|
|
- br.ErrMsg = "查询浏览记录数量失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- var recordItem *models.CygxPageHistoryRecord
|
|
|
- if count > 1 {
|
|
|
- recordItem, err = models.GetTimeLineRecordItem(user.UserId, industrialManagementId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "查询浏览记录失败"
|
|
|
- br.ErrMsg = "查询浏览记录失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
+ //count, err := models.GetTimeLineRecordCount(user.UserId, industrialManagementId)
|
|
|
+ //if err != nil {
|
|
|
+ // br.Msg = "查询浏览记录数量失败"
|
|
|
+ // br.ErrMsg = "查询浏览记录数量失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //var recordItem *models.CygxPageHistoryRecord
|
|
|
+ //if count > 1 {
|
|
|
+ // recordItem, err = models.GetTimeLineRecordItem(user.UserId, industrialManagementId)
|
|
|
+ // if err != nil {
|
|
|
+ // br.Msg = "查询浏览记录失败"
|
|
|
+ // br.ErrMsg = "查询浏览记录失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ //}
|
|
|
|
|
|
for k, v := range list {
|
|
|
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
|
|
|
}
|
|
|
- timeLineRed := false
|
|
|
- if count < 2 && v.SubCategoryName == "时间线" {
|
|
|
- timeLineRed = true
|
|
|
- } else if count > 1 && recordItem.CreateTime.Before(utils.StrTimeToTime(v.PublishTime)) {
|
|
|
- timeLineRed = true
|
|
|
- }
|
|
|
- if v.SubCategoryName == "时间线" && timeLineRed {
|
|
|
- list[k].IsRed = true
|
|
|
- }
|
|
|
+ //timeLineRed := false
|
|
|
+ //if count < 2 && v.SubCategoryName == "时间线" {
|
|
|
+ // timeLineRed = true
|
|
|
+ //} else if count > 1 && recordItem.CreateTime.Before(utils.StrTimeToTime(v.PublishTime)) {
|
|
|
+ // timeLineRed = true
|
|
|
+ //}
|
|
|
+ //if v.SubCategoryName == "时间线" && timeLineRed {
|
|
|
+ list[k].IsRed = true
|
|
|
+ //}
|
|
|
if v.VideoUrl != "" {
|
|
|
list[k].IsHaveVideo = true
|
|
|
}
|