|
@@ -1167,7 +1167,7 @@ func (this *ReportController) ReportListByType() {
|
|
|
br.Ret = 408
|
|
|
return
|
|
|
}
|
|
|
- //uid := user.UserId
|
|
|
+ uid := user.UserId
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
reportType := this.GetString("ReportType")
|
|
@@ -1185,12 +1185,17 @@ func (this *ReportController) ReportListByType() {
|
|
|
resp := new(models.CygxReportSelectionListPublicRep)
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
var tbdb string
|
|
|
+ var readSql string
|
|
|
+ var reportTypeStr string
|
|
|
if reportType == "1" {
|
|
|
tbdb = "cygx_report_selection"
|
|
|
+ reportTypeStr = "bgjx"
|
|
|
} else if reportType == "2" {
|
|
|
tbdb = "cygx_research_summary"
|
|
|
+ reportTypeStr = "bzyjhz"
|
|
|
} else if reportType == "3" {
|
|
|
tbdb = "cygx_minutes_summary"
|
|
|
+ reportTypeStr = "szjyhz"
|
|
|
} else {
|
|
|
br.Msg = "请选择报告类型"
|
|
|
return
|
|
@@ -1203,8 +1208,9 @@ func (this *ReportController) ReportListByType() {
|
|
|
br.ErrMsg = "获取帖子总数失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ readSql = ` (SELECT COUNT(1) AS count FROM cygx_report_history_record AS h WHERE h.article_id = art.article_id AND report_type ='` + reportTypeStr + `' AND h.user_id = ` + strconv.Itoa(uid) + `) as read_num`
|
|
|
page = paging.GetPaging(currentIndex, pageSize, total)
|
|
|
- list, err := models.GetReportSelectionListPublic(condition, tbdb, pars, startSize, pageSize)
|
|
|
+ list, err := models.GetReportSelectionListPublic(condition, readSql, tbdb, pars, startSize, pageSize)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
@@ -1216,6 +1222,9 @@ func (this *ReportController) ReportListByType() {
|
|
|
list[k].Abstract = v.UpdateDescription
|
|
|
}
|
|
|
list[k].PublishDate = utils.StrTimeToTime(v.PublishDate).Format("2006-01-02")
|
|
|
+ if v.ReadNum == 0 {
|
|
|
+ list[k].IsRed = true
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
resp.List = list
|