xingzai 1 жил өмнө
parent
commit
cb8b7a57e4
1 өөрчлөгдсөн 3 нэмэгдсэн , 2 устгасан
  1. 3 2
      models/report.go

+ 3 - 2
models/report.go

@@ -969,8 +969,8 @@ func GetArticleResearchListYx(condition string, pars []interface{}, startSize, p
 	if condition != "" {
 		sql += condition
 	}
-
-	sql += `UNION ALL
+	if needYanxuanSpecial {
+		sql += `UNION ALL
 	SELECT
 		a.id AS article_id,
 		a.title AS title,
@@ -994,6 +994,7 @@ 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 += ` 	GROUP BY  article_id ORDER  BY top_time DESC , publish_date DESC   LIMIT  ?,? `
 	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
 	return