xingzai 1 år sedan
förälder
incheckning
1ee41ab11f
1 ändrade filer med 14 tillägg och 11 borttagningar
  1. 14 11
      models/report.go

+ 14 - 11
models/report.go

@@ -941,7 +941,10 @@ func GetArticleResearchListYx(condition string, pars []interface{}, startSize, p
 	sql := `SELECT
 			a.article_id,
 			a.title,
-			a.publish_date AS publish_time,
+			a.body,
+			a.annotation,
+			a.abstract,
+			a.publish_date,
 			a.article_type_id,
 			d.nick_name,
 			d.department_id,
@@ -949,33 +952,34 @@ func GetArticleResearchListYx(condition string, pars []interface{}, startSize, p
 			0 as pv,
 			0 as collect_num,
 			0 AS special_type,
-			0 AS user_id,
+			0 AS special_column_id,
 			'' AS company_tags, 
 			'' AS industry_tags
 		FROM
 			cygx_article AS a
 			INNER JOIN cygx_article_department AS d ON d.department_id = a.department_id 
 		WHERE
-			1 = 1  AND a.publish_status = 1
-		  `
+			1 = 1  AND a.publish_status = 1  `
 	if condition != "" {
 		sql += condition
 	}
-	sql += ` GROUP BY a.article_id  `
 	if needYanxuanSpecial {
 		sql += `UNION ALL
 	SELECT
 		a.id AS article_id,
 		a.title AS title,
-		a.publish_time AS publish_time,
+		'' AS body,
+		a.content AS annotation,
+		'' AS abstract,
+		a.publish_time AS publish_date,
 		-1 AS article_type_id,
 		b.nick_name AS nick_name,
-		a.user_id AS department_id,
+		0 AS department_id,
 		1 AS is_special,
 		a.pv,
 		a.article_collect_num as collect_num,
 		a.type AS special_type,
-		a.user_id AS user_id,
+		b.id AS special_column_id,
 		a.company_tags AS company_tags, 
 		a.industry_tags AS industry_tags 
 	FROM
@@ -983,13 +987,12 @@ func GetArticleResearchListYx(condition string, pars []interface{}, startSize, p
 	JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
 	WHERE
 	1 = 1  AND a.status = 3 `
-		sql += ` ORDER  BY publish_time DESC  LIMIT ?,? `
+		sql += ` GROUP BY article_id ORDER  BY publish_date DESC  LIMIT ?,? `
 		_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
 	} else {
-		sql += ` ORDER  BY publish_time DESC  LIMIT ?,? `
+		sql += ` GROUP BY a.article_id ORDER  BY a.publish_date DESC  LIMIT ?,? `
 		_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
 	}
-
 	return
 }