コード例 #1
0
func HasViewArticle(articleId int64, userId int64, ip string, db db.DB) (bool, error) {

	count, err := db.QueryTable("article_view").Filter("article_id", articleId).Filter("ip", ip).Count()

	return count > 0, err
}
コード例 #2
0
func HasLikeArticle(articleId int64, userId int64, db db.DB) (bool, error) {
	count, err := db.QueryTable("article_like").Filter("user_id", userId).Filter("article_id", articleId).Filter("valid", 1).Count()

	return count > 0, err
}