|
@@ -136,14 +136,14 @@ type CheckStatusResp struct {
|
|
|
}
|
|
|
|
|
|
func GetArticleUserCollectCount(userId int) (count int, err error) {
|
|
|
- sql := `SELECT COUNT(1) AS count FROM cygx_article_collect AS a INNER JOIN cygx_article as art ON art.article_id = a.article_id WHERE a.user_id=? AND publish_status = 1 `
|
|
|
+ sql := `SELECT COUNT(1) AS count FROM cygx_article_collect AS a INNER JOIN cygx_article as art ON art.article_id = a.article_id WHERE a.user_id=? AND art.publish_status = 1 `
|
|
|
err = orm.NewOrm().Raw(sql, userId).QueryRow(&count)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
func GetArticleUserCollectList(startSize, pageSize, userId int) (items []*ArticleCollectList, err error) {
|
|
|
sql := `SELECT a.* FROM cygx_article_collect AS a INNER JOIN cygx_article as art ON art.article_id = a.article_id
|
|
|
- WHERE a.user_id=? AND publish_status = 1
|
|
|
+ WHERE a.user_id=? AND art.publish_status = 1
|
|
|
ORDER BY a.create_time DESC LIMIT ?,? `
|
|
|
_, err = orm.NewOrm().Raw(sql, userId, startSize, pageSize).QueryRows(&items)
|
|
|
return
|