Beispiel #1
0
//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
}
Beispiel #2
0
//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
}
Beispiel #3
0
//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
}