示例#1
0
文件: util.go 项目: trigrass2/wego
func PostReplysCount(post *models.Post) {
	cnt, err := models.CountCommentsByPostId(post.Id)
	if err == nil {
		post.Replys = int(cnt)
		//disable post editable
		post.CanEdit = false
		err = models.UpdateById(post.Id, post, "replys", "can_edit")
	}
	if err != nil {
		log.Error("PostReplysCount ", err)
	}
}