Ejemplo n.º 1
0
//Get new best posts by category
func (this *PostListRouter) setNewBestPostsOfCategory(posts *[]models.Post, cat *models.Category) {
	err := models.NewBestPostsByExample(posts, &models.Post{CategoryId: cat.Id})
	if err != nil {
		this.Result = err
		return
	}

	this.Data["NewBestPosts"] = posts
}
Ejemplo n.º 2
0
//Get new best posts by topic
func (this *PostListRouter) setNewBestPostsOfTopic(posts *[]models.Post, topic *models.Topic) {
	err := models.NewBestPostsByExample(posts, &models.Post{TopicId: topic.Id})
	if err != nil {
		this.Result = err
		return
	}

	this.Data["NewBestPosts"] = posts
}
Ejemplo n.º 3
0
//Get new best posts
func (this *PostListRouter) setNewBestPosts(posts *[]models.Post) {
	err := models.NewBestPostsByExample(posts, &models.Post{})
	if err != nil {
		this.Result = err
		return
	}

	this.Data["NewBestPosts"] = posts
}