|
@@ -3,6 +3,7 @@ package report
|
|
|
import (
|
|
|
"hongze/hongze_yb/global"
|
|
|
"hongze/hongze_yb/models/response"
|
|
|
+ "hongze/hongze_yb/models/response/pc"
|
|
|
"hongze/hongze_yb/utils"
|
|
|
)
|
|
|
|
|
@@ -314,7 +315,7 @@ WHERE
|
|
|
}
|
|
|
|
|
|
// GetLatestReportByPermission 根据权限相关的分类查询最新的三篇专栏报告
|
|
|
-func GetLatestReportByPermission(classifyIdSeconds []int) (list []*response.ReportCollectListItem, err error) {
|
|
|
+func GetLatestReportByPermission(classifyIdSeconds []int) (list []*pc.LatestReport, err error) {
|
|
|
sql := `SELECT
|
|
|
id AS report_id,
|
|
|
0 AS report_chapter_id,
|
|
@@ -325,6 +326,7 @@ classify_name_second,
|
|
|
0 as report_chapter_type_id,
|
|
|
title,
|
|
|
content_sub,
|
|
|
+stage,
|
|
|
publish_time
|
|
|
FROM
|
|
|
report
|
|
@@ -333,8 +335,34 @@ WHERE
|
|
|
AND classify_name_first != "周报"
|
|
|
AND classify_id_second in ?
|
|
|
AND state = 2
|
|
|
- ORDER BY publish_time DESC, report_id desc LIMIT 3
|
|
|
+ ORDER BY publish_time DESC LIMIT 3
|
|
|
`
|
|
|
err = global.MYSQL["rddp"].Raw(sql, classifyIdSeconds).Scan(&list).Error
|
|
|
return
|
|
|
+}
|
|
|
+
|
|
|
+// GetLatestReport 获取最新专栏信息
|
|
|
+func GetLatestReport() (list *pc.LatestReport, err error) {
|
|
|
+ sql := `SELECT
|
|
|
+id AS report_id,
|
|
|
+0 AS report_chapter_id,
|
|
|
+classify_id_first,
|
|
|
+classify_id_second,
|
|
|
+classify_name_first,
|
|
|
+classify_name_second,
|
|
|
+0 as report_chapter_type_id,
|
|
|
+title,
|
|
|
+content_sub,
|
|
|
+stage,
|
|
|
+publish_time
|
|
|
+FROM
|
|
|
+ report
|
|
|
+WHERE
|
|
|
+ classify_name_first != "晨报"
|
|
|
+ AND classify_name_first != "周报"
|
|
|
+ AND state = 2
|
|
|
+ ORDER BY publish_time DESC LIMIT 1
|
|
|
+ `
|
|
|
+ err = global.MYSQL["rddp"].Raw(sql).First(&list).Error
|
|
|
+ return
|
|
|
}
|