|
@@ -194,9 +194,9 @@ func GetArticleUserBrowseHistoryCount(userId int, endDate string) (count int, er
|
|
|
}
|
|
|
|
|
|
func GetArticleUserBrowseHistoryList(startSize, pageSize, userId int, endDate string) (items []*ArticleReportBillboardResp, err error) {
|
|
|
- sql := `SELECT a.* FROM cygx_article_history_record AS a
|
|
|
+ sql := `SELECT a.* , MAX( a.id ) AS mid FROM cygx_article_history_record AS a
|
|
|
WHERE a.user_id=? AND a.create_time>=? GROUP BY a.article_id
|
|
|
- ORDER BY a.id DESC LIMIT ?,? `
|
|
|
+ ORDER BY mid DESC LIMIT ?,? `
|
|
|
_, err = orm.NewOrm().Raw(sql, userId, endDate, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|