Explorar o código

我的足迹排序

xingzai %!s(int64=2) %!d(string=hai) anos
pai
achega
078cbcc2f4
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      models/user.go

+ 2 - 2
models/user.go

@@ -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
 }