|
@@ -174,9 +174,9 @@ func DocumentReportList(documentType int, chartPermissionIdList []string, classi
|
|
|
}
|
|
|
|
|
|
if orderField != "" && orderType != "" {
|
|
|
- condition += ` order by t1.` + orderField + ` ` + orderType
|
|
|
+ condition += ` group by t1.outside_report_id order by t1.` + orderField + ` ` + orderType
|
|
|
} else {
|
|
|
- condition += ` order by t1.modify_time desc`
|
|
|
+ condition += ` group by t1.outside_report_id order by t1.report_update_time desc`
|
|
|
}
|
|
|
|
|
|
outsideReportList, err := document_manage_model.GetOutsideReportListByCondition(condition, pars, startSize, pageSize)
|
|
@@ -231,12 +231,6 @@ func RuiSiReportList(classifyIdFirst, classifyIdSecond, classifyIdThird int, cha
|
|
|
condition += ` AND a.classify_id_third = ? `
|
|
|
pars = append(pars, classifyIdThird)
|
|
|
}
|
|
|
- if len(chartPermissionIdList) > 0 {
|
|
|
- condition += ` and b.chart_permission_id in (` + utils.GetOrmInReplace(len(chartPermissionIdList)) + `)`
|
|
|
- for _, chartPermissionId := range chartPermissionIdList {
|
|
|
- pars = append(pars, chartPermissionId)
|
|
|
- }
|
|
|
- }
|
|
|
if keyword != "" {
|
|
|
condition += ` and ( a.title like ? or a.admin_real_name like ? ) `
|
|
|
pars = append(pars, "%"+keyword+"%", "%"+keyword+"%")
|
|
@@ -247,6 +241,28 @@ func RuiSiReportList(classifyIdFirst, classifyIdSecond, classifyIdThird int, cha
|
|
|
// 已发布的报告
|
|
|
condition += ` and a.state = 2`
|
|
|
|
|
|
+ if len(chartPermissionIdList) > 0 {
|
|
|
+ classifyIds, err := models.GetClassifyIdsByPermissionId(chartPermissionIdList)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ if len(classifyIds) > 0 {
|
|
|
+ condition += ` AND ( (a.classify_id_first IN (` + utils.GetOrmInReplace(len(classifyIds)) + `) AND a.classify_id_second = 0)
|
|
|
+ OR (a.classify_id_second IN (` + utils.GetOrmInReplace(len(classifyIds)) + `) AND a.classify_id_third = 0)
|
|
|
+ OR a.classify_id_third IN (` + utils.GetOrmInReplace(len(classifyIds)) + `) )`
|
|
|
+ for _, classifyId := range classifyIds {
|
|
|
+ pars = append(pars, classifyId)
|
|
|
+ }
|
|
|
+ for _, classifyId := range classifyIds {
|
|
|
+ pars = append(pars, classifyId)
|
|
|
+ }
|
|
|
+ for _, classifyId := range classifyIds {
|
|
|
+ pars = append(pars, classifyId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
count, err := models.GetReportListCountV1(condition, pars)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
@@ -260,9 +276,9 @@ func RuiSiReportList(classifyIdFirst, classifyIdSecond, classifyIdThird int, cha
|
|
|
}
|
|
|
|
|
|
if orderField != "" && orderType != "" {
|
|
|
- condition += ` order by a.` + orderField + ` ` + orderType
|
|
|
+ condition += ` group by a.id order by a.` + orderField + ` ` + orderType
|
|
|
} else {
|
|
|
- condition += ` order by a.publish_time desc`
|
|
|
+ condition += ` group by a.id order by a.publish_time desc`
|
|
|
}
|
|
|
|
|
|
reportList, err := models.GetReportListByCondition(condition, pars, startSize, pageSize)
|
|
@@ -390,7 +406,7 @@ func DocumentUpdate(outsideReport *document_manage_model.OutsideReportBO) error
|
|
|
report.Content = outsideReport.Content
|
|
|
}
|
|
|
report.ModifyTime = utils.GetCurrentTime()
|
|
|
- report.ReportUpdateTime = utils.GetCurrentTime()
|
|
|
+ //report.ReportUpdateTime = utils.GetCurrentTime()
|
|
|
err = document_manage_model.UpdateOutsideReport(report)
|
|
|
if err != nil {
|
|
|
return fmt.Errorf("更新报告失败, Err: %s", err.Error())
|