|
@@ -6,7 +6,7 @@ import (
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
-type RecommendReport struct {
|
|
|
+type Report struct {
|
|
|
Id int `description:"报告Id"`
|
|
|
AddType int `description:"新增方式:1:新增报告,2:继承报告"`
|
|
|
ClassifyIdFirst int `description:"一级分类id"`
|
|
@@ -34,9 +34,15 @@ type RecommendReport struct {
|
|
|
TitleType string `description:"标题类型,FICC或者权益"`
|
|
|
}
|
|
|
|
|
|
-func GetRecommendList(reportId, reportType int) (items []*RecommendReport, err error) {
|
|
|
- sql := `SELECT * FROM report WHERE state=2 AND id<> %v`
|
|
|
- sql = fmt.Sprintf(sql, reportId)
|
|
|
+func GetLatestReportList() (items []*Report, err error) {
|
|
|
+ sql := `SELECT * FROM report WHERE state=2 ORDER BY publish_time DESC LIMIT 3 `
|
|
|
+ err = global.MYSQL["rddp"].Raw(sql).Scan(&items).Error
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func GetRecommendList(reportId, reportType, secondId int) (items []*Report, err error) {
|
|
|
+ sql := `SELECT * FROM report WHERE state=2 AND id<> %v AND classify_id_second=%v `
|
|
|
+ sql = fmt.Sprintf(sql, reportId, secondId)
|
|
|
if reportType == 1 {
|
|
|
sql += ` AND classify_name_first='权益研报' `
|
|
|
} else {
|