コード例 #1
0
ファイル: post.go プロジェクト: trigrass2/wego
//Get most replys posts
func (this *PostListRouter) setMostReplysPosts(posts *[]models.Post) {
	err := models.MostReplysPostsByExample(posts, &models.Post{})
	if err != nil {
		this.Result = err
		return
	}
	this.Data["MostReplysPosts"] = posts
}
コード例 #2
0
ファイル: post.go プロジェクト: trigrass2/wego
//Get most replys posts of category
func (this *PostListRouter) setMostReplysPostsOfCategory(posts *[]models.Post, cat *models.Category) {
	err := models.MostReplysPostsByExample(posts, &models.Post{CategoryId: cat.Id})
	if err != nil {
		this.Result = err
		return
	}
	this.Data["MostReplysPosts"] = posts
}
コード例 #3
0
ファイル: post.go プロジェクト: trigrass2/wego
//Get most replys post of topic
func (this *PostListRouter) setMostReplysPostsOfTopic(posts *[]models.Post, topic *models.Topic) {
	err := models.MostReplysPostsByExample(posts, &models.Post{TopicId: topic.Id})
	if err != nil {
		this.Result = err
		return
	}
	this.Data["MostReplysPosts"] = posts
}