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) } }