|
@@ -2858,7 +2858,7 @@ func (this *ReportController) SearchReportAndResource() {
|
|
|
for _, v := range listHot {
|
|
|
mapHot[v.IndustryName] = v.IndustrialManagementId
|
|
|
}
|
|
|
-
|
|
|
+ orderSrt := "man.recommended_index DESC,update_time DESC"
|
|
|
for k, v := range listHzResource {
|
|
|
// 关联报告发布时间均在3个月内则标记New
|
|
|
if v.MinReportTime != "" {
|
|
@@ -2879,9 +2879,46 @@ func (this *ReportController) SearchReportAndResource() {
|
|
|
if fllowMap[v.IndustrialManagementId] > 0 {
|
|
|
listHzResource[k].IsFollw = true
|
|
|
}
|
|
|
- if v.Readnum == 0 && user.CreatedTime.Before(utils.StrDateToTime(v.PublishDate)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrDateToTime(v.PublishDate)) {
|
|
|
- listHzResource[k].IsRed = true
|
|
|
+ industrialIdSlice := make([]int, 0)
|
|
|
+ articleIdArr := make([]int, 0)
|
|
|
+ industrialIdSlice = append(industrialIdSlice, v.IndustrialManagementId)
|
|
|
+ listUpdateTime, err := models.GetNewArticleDetailByIndustrialIds(industrialIdSlice)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range listUpdateTime {
|
|
|
+ articleIdArr = append(articleIdArr, v.ArticleId)
|
|
|
+ }
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapHistroyArticleId := make(map[int]int)
|
|
|
+
|
|
|
+ if user.UserId > 0 {
|
|
|
+ listArticleHistory, e := models.GetUserToArticleHistory(user.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
|
|
|
+ }
|
|
|
+ }
|
|
|
+ condition2 := ` AND man.industry_name IN (` + "'"+keyWord+ "'" + `)`
|
|
|
+ list, err := models.GetIndustrialManagementAll(uid, condition2, orderSrt, 0, 20)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
}
|
|
|
+
|
|
|
+ for _, v2 := range list {
|
|
|
+ if mapHistroyArticleId[v2.ArticleId] == 0 && user.CreatedTime.Before(utils.StrDateToTime(v.PublishDate)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrDateToTime(v.PublishDate)) {
|
|
|
+ listHzResource[k].IsRed = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
industrialIdArr = append(industrialIdArr, v.IndustrialManagementId)
|
|
|
}
|
|
|
|