|
@@ -174,7 +174,9 @@ type ArticleInterviewApplyListResp struct {
|
|
|
}
|
|
|
|
|
|
func GetArticleUserBrowseHistoryCount(userId int, endDate string) (count int, err error) {
|
|
|
- sql := `SELECT COUNT(1) AS count FROM cygx_article_history_record AS a WHERE a.user_id=? AND a.create_time>=? `
|
|
|
+ sql := `SELECT COUNT( 1 ) as count
|
|
|
+ FROM
|
|
|
+ ( SELECT count(*) FROM cygx_article_history_record AS a WHERE a.user_id = ? AND a.create_time >= ? GROUP BY a.article_id ) b `
|
|
|
err = orm.NewOrm().Raw(sql, userId, endDate).QueryRow(&count)
|
|
|
return
|
|
|
}
|