|
@@ -60,6 +60,26 @@ type ReportPushStatus struct {
|
|
|
PushTime time.Time `description:"推送时间"`
|
|
|
}
|
|
|
|
|
|
+type ReportPushView struct {
|
|
|
+ ReportPushStatusId int `orm:"pk"`
|
|
|
+ ReportId int `description:"报告id"`
|
|
|
+ Title string `description:"报告标题"`
|
|
|
+ Abstract string `description:"报告摘要"`
|
|
|
+ ClassifyIdFirst int `description:"一级分类id"`
|
|
|
+ ClassifyNameFirst string `description:"一级分类名称"`
|
|
|
+ ClassifyIdSecond int `description:"二级分类id"`
|
|
|
+ ClassifyNameSecond string `description:"二级分类名称"`
|
|
|
+ ClassifyIdThird int `description:"二级分类id"`
|
|
|
+ ClassifyNameThird string `description:"二级分类名称"`
|
|
|
+ Author string `description:"报告作者"`
|
|
|
+ State int `description:"报告状态:0-未推送,1-已推送"`
|
|
|
+ PushTime string `description:"推送时间"`
|
|
|
+ PublishTime string `description:"报告发布时间"`
|
|
|
+ ReportType int `description:"报告类型:1-eta报告"`
|
|
|
+ CreateTime string `description:"创建时间"`
|
|
|
+ ModifyTime string `description:"修改时间"`
|
|
|
+}
|
|
|
+
|
|
|
// GetReportDailyListCount 获得今日报告数量
|
|
|
func GetReportDailyListCount() (count int, err error) {
|
|
|
o := orm.NewOrmUsingDB("rddp")
|
|
@@ -155,7 +175,7 @@ func GetPushReportCountByClassifyIds(classifyFirstIds, classifySecondIds, classi
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetPushReportListByClassifyIds(classifyFirstIds, classifySecondIds, classifyThirdIds []int, condition string, startSize, pageSize int) (items []*ReportPushStatus, err error) {
|
|
|
+func GetPushReportListByClassifyIds(classifyFirstIds, classifySecondIds, classifyThirdIds []int, condition string, startSize, pageSize int) (items []*ReportPushView, err error) {
|
|
|
if len(classifyFirstIds) == 0 && len(classifySecondIds) == 0 && len(classifyThirdIds) == 0 {
|
|
|
return
|
|
|
}
|
|
@@ -180,6 +200,20 @@ func GetPushReportListByClassifyIds(classifyFirstIds, classifySecondIds, classif
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func GetPushReportCount() (count int, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := ` SELECT COUNT(*) AS count FROM report_push_status WHERE state=1 AND report_type=1 `
|
|
|
+ err = o.Raw(sql).QueryRow(&count)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func GetPushReportListByPage(startSize, pageSize int) (items []*ReportPushView, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := ` SELECT * FROM report_push_status WHERE state=1 AND report_type=1 ORDER BY publish_time DESC LIMIT ?,? `
|
|
|
+ _, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func GetReportByClassifyIds(classifyIds []int, condition string) (count int, err error) {
|
|
|
if len(classifyIds) == 0 {
|
|
|
return
|