|
@@ -627,3 +627,58 @@ func GetIndustryByName(industryName string) (item *IndustrialManagement, err err
|
|
|
err = orm.NewOrm().Raw(sql, industryName).QueryRow(&item)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+type IndustrialManagementArticle struct {
|
|
|
+ IndustrialManagementId int `description:"产业Id"`
|
|
|
+ IndustryName string `description:"产业名称"`
|
|
|
+ ArticleId int `description:"文章ID"`
|
|
|
+ PublishDate string `description:"发布时间"`
|
|
|
+}
|
|
|
+
|
|
|
+//时间线的更新时间
|
|
|
+func GetTimeLineReportIndustrialPublishdateList(industrialIdArr []int) (items []*IndustrialManagementArticle, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT
|
|
|
+ mmc.id,
|
|
|
+ 0,
|
|
|
+ mmc.industry_id AS industrial_management_id,
|
|
|
+ mmc.content AS title,
|
|
|
+ mm.meeting_time AS publish_date
|
|
|
+ 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 IN (` + utils.GetOrmInReplace(len(industrialIdArr)) + `)
|
|
|
+ GROUP BY industrial_management_id ORDER BY publish_date DESC `
|
|
|
+ _, err = o.Raw(sql, industrialIdArr).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+//获取该产业下最新的文章详情
|
|
|
+func GetNewArticleDetailByIndustrialIds(industrialIdArr []int) (items []*IndustrialManagementArticle, err error) {
|
|
|
+ arrLen := len(industrialIdArr)
|
|
|
+ if arrLen == 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT
|
|
|
+ mg.industrial_management_id,
|
|
|
+ MAX( a.article_id ) AS article_id,
|
|
|
+ a.title,
|
|
|
+ MAX( a.publish_date ) AS publish_date
|
|
|
+ FROM
|
|
|
+ cygx_industrial_article_group_management AS mg
|
|
|
+ INNER JOIN cygx_article AS a ON mg.article_id = a.article_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND a.article_id < ?
|
|
|
+ AND a.is_report = 1
|
|
|
+ AND a.is_class = 1
|
|
|
+ AND mg.industrial_management_id IN(` + utils.GetOrmInReplace(len(industrialIdArr)) + `)
|
|
|
+ GROUP BY
|
|
|
+ mg.industrial_management_id `
|
|
|
+ _, err = o.Raw(sql, utils.SummaryArticleId, industrialIdArr).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|