瀏覽代碼

no message

xingzai 1 年之前
父節點
當前提交
218288ea91
共有 3 個文件被更改,包括 8 次插入3 次删除
  1. 1 0
      controllers/research.go
  2. 1 0
      models/home.go
  3. 6 3
      models/report.go

+ 1 - 0
controllers/research.go

@@ -163,6 +163,7 @@ func (this *MobileResearchController) ArticleNewList() {
 			ButtonStyle:     styleMap[v.ArticleTypeId],
 			List:            v.List,
 			SpecialColumnId: v.SpecialColumnId,
+			TopTime:         v.TopTime,
 		}
 		if v.IsSpecial == 1 {
 			//去除图片标签

+ 1 - 0
models/home.go

@@ -84,6 +84,7 @@ type ArticleListResp struct {
 	SpecialColumnId     int      `description:"专栏栏目id"`
 	SpecialType         int      `description:"专栏类型 1:笔记,2:观点"`
 	List                []*IndustrialManagementIdInt
+	TopTime             int `description:"置顶时间"`
 }
 
 type HomeChartListResp struct {

+ 6 - 3
models/report.go

@@ -851,6 +851,7 @@ type ArticleResearchResp struct {
 	IndustryTags    []string                     `description:"研选专栏行业标签"`
 	CompanyTags     []string                     `description:"研选专栏公司标签"`
 	SpecialColumnId int                          `description:"专栏栏目id"`
+	TopTime         int                          `description:"置顶时间"`
 }
 
 // 获取数量
@@ -891,7 +892,8 @@ func GetArticleResearchList(condition string, pars []interface{}, startSize, pag
 			0 AS special_type,
 			0 AS special_column_id,
 			'' AS company_tags, 
-			'' AS industry_tags
+			'' AS industry_tags,
+			a.top_time
 		FROM
 			cygx_article AS a
 			LEFT JOIN cygx_industrial_article_group_management AS mg ON mg.article_id = a.article_id
@@ -922,7 +924,8 @@ func GetArticleResearchList(condition string, pars []interface{}, startSize, pag
 		a.type AS special_type,
 		b.id AS special_column_id,
 		a.company_tags AS company_tags, 
-		a.industry_tags AS industry_tags 
+		a.industry_tags AS industry_tags,
+		0 as top_time
 	FROM
 	cygx_yanxuan_special AS a
 	JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
@@ -931,7 +934,7 @@ func GetArticleResearchList(condition string, pars []interface{}, startSize, pag
 		sql += ` GROUP BY article_id ORDER  BY publish_date DESC  LIMIT ?,? `
 		_, err = o.Raw(sql, userId, userId, pars, startSize, pageSize).QueryRows(&items)
 	} else {
-		sql += ` GROUP BY a.article_id ORDER  BY a.publish_date DESC  LIMIT ?,? `
+		sql += ` GROUP BY  a.article_id ORDER  BY top_time DESC , a.publish_date DESC  LIMIT ?,? `
 		_, err = o.Raw(sql, userId, pars, startSize, pageSize).QueryRows(&items)
 	}
 	return