|
@@ -403,6 +403,64 @@ func GetTimeLineReportIndustrialList(industrialManagementId, startSize, pageSize
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+type TimeLineReportItem struct {
|
|
|
+ Id int `description:"文章或晨报点评id"`
|
|
|
+ Title string `description:"标题"`
|
|
|
+ PublishTime string `description:"发布时间"`
|
|
|
+ Content string `description:"内容"`
|
|
|
+ VideoUrl string `description:"视频链接"`
|
|
|
+ IsHaveVideo bool `description:"是否包含视频"`
|
|
|
+ ImgUrlPc string `description:"pc图片"`
|
|
|
+ SubCategoryName string `description:"二级分类"`
|
|
|
+ IsRed bool `description:"是否标红"`
|
|
|
+ Readnum int `description:"阅读数量"`
|
|
|
+}
|
|
|
+
|
|
|
+// 获取产业报告+晨会点评列表
|
|
|
+func GetTimeLineReportIndustrialListRed(userId, industrialManagementId, startSize, pageSize int) (items []*TimeLineReportItem, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT
|
|
|
+ *
|
|
|
+FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.article_id AS id,
|
|
|
+ a.title,
|
|
|
+ a.publish_date AS publish_time,
|
|
|
+ a.video_url,
|
|
|
+ a.sub_category_name,
|
|
|
+ '' AS content,
|
|
|
+ ( SELECT COUNT( 1 ) FROM cygx_article_history_record AS rec WHERE rec.user_id = ` + strconv.Itoa(userId) + ` AND rec.article_id = a.article_id ) AS readnum
|
|
|
+ FROM
|
|
|
+ cygx_article AS a
|
|
|
+ INNER JOIN cygx_industrial_article_group_management AS man_g ON man_g.article_id = a.article_id
|
|
|
+ WHERE
|
|
|
+ a.publish_status = 1
|
|
|
+ AND a.is_class = 1
|
|
|
+ AND man_g.industrial_management_id = ? GROUP BY id UNION ALL
|
|
|
+ SELECT
|
|
|
+ mmc.id,
|
|
|
+ '' AS title,
|
|
|
+ mm.publish_time AS publish_time,
|
|
|
+ '' AS video_url,
|
|
|
+ '时间线' AS sub_category_name,
|
|
|
+ mmc.content,
|
|
|
+ 0 AS readnum
|
|
|
+ FROM
|
|
|
+ cygx_morning_meeting_review_chapter AS mmc
|
|
|
+ INNER JOIN cygx_morning_meeting_reviews AS mm
|
|
|
+ WHERE
|
|
|
+ mm.id = mmc.meeting_id
|
|
|
+ AND mm.STATUS = 1
|
|
|
+ AND mmc.industry_id = ?
|
|
|
+ ) AS t
|
|
|
+`
|
|
|
+ sql += ` ORDER BY
|
|
|
+ t.publish_time DESC LIMIT ?,? `
|
|
|
+ _, err = o.Raw(sql, industrialManagementId, industrialManagementId, startSize, pageSize).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
type IndustrialPublishdate struct {
|
|
|
PublishDate string `description:"发布时间"`
|
|
|
IndustrialManagementId int `description:"产业D"`
|