示例#1
0
文件: post.go 项目: trigrass2/wego
//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
}
示例#2
0
文件: post.go 项目: trigrass2/wego
//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
}
示例#3
0
文件: post.go 项目: trigrass2/wego
//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
}