|
@@ -23,42 +23,42 @@ func GetShowTimeLineIsRed(user *models.WxUserItem, industrialManagementId int) (
|
|
|
return
|
|
|
}
|
|
|
//查询用户今天是否看过时间线
|
|
|
- haveMorningMeeting := false
|
|
|
- var morningMeetingTime string
|
|
|
- count, e := models.GetTimeLineRecordCount(user.UserId, industrialManagementId)
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetTimeLineRecordCount, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- var recordItem *models.CygxPageHistoryRecord
|
|
|
- if count > 1 {
|
|
|
- recordItem, e = models.GetTimeLineRecordItem(user.UserId, industrialManagementId)
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetTimeLineRecordCount, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
+ //haveMorningMeeting := false
|
|
|
+ //var morningMeetingTime string
|
|
|
+ //count, e := models.GetTimeLineRecordCount(user.UserId, industrialManagementId)
|
|
|
+ //if e != nil {
|
|
|
+ // err = errors.New("GetTimeLineRecordCount, Err: " + e.Error())
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //var recordItem *models.CygxPageHistoryRecord
|
|
|
+ //if count > 1 {
|
|
|
+ // recordItem, e = models.GetTimeLineRecordItem(user.UserId, industrialManagementId)
|
|
|
+ // if e != nil {
|
|
|
+ // err = errors.New("GetTimeLineRecordCount, Err: " + e.Error())
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ //}
|
|
|
|
|
|
for _, v := range timeLineList {
|
|
|
if v.Readnum == 0 && user.CreatedTime.Before(utils.StrTimeToTime(v.PublishDate)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(v.PublishDate)) {
|
|
|
if v.SubCategoryName == "时间线" {
|
|
|
- haveMorningMeeting = true
|
|
|
- morningMeetingTime = v.PublishDate
|
|
|
+ //haveMorningMeeting = true
|
|
|
+ //morningMeetingTime = v.PublishDate
|
|
|
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
|
|
|
+ //}
|
|
|
isRed = timeLineItem.IsRed
|
|
|
return
|
|
|
|