()
| 643 | } |
| 644 | |
| 645 | func (this *ManagerController) Comments() { |
| 646 | status := this.GetString("status", "0") |
| 647 | statusNum, _ := strconv.Atoi(status) |
| 648 | p, _ := this.GetInt("page", 1) |
| 649 | size, _ := this.GetInt("size", 10) |
| 650 | m := models.NewComments() |
| 651 | opt := models.CommentOpt{} |
| 652 | if status == "" { |
| 653 | this.Data["Comments"], _ = m.Comments(p, size, opt) |
| 654 | } else { |
| 655 | opt.Status = []int{statusNum} |
| 656 | this.Data["Comments"], _ = m.Comments(p, size, opt) |
| 657 | } |
| 658 | this.Data["IsComments"] = true |
| 659 | this.Data["Status"] = status |
| 660 | count, _ := m.Count(0, statusNum) |
| 661 | this.Data["Count"] = count |
| 662 | if count > 0 { |
| 663 | html := utils.GetPagerHtml(this.Ctx.Request.RequestURI, p, size, int(count)) |
| 664 | this.Data["PageHtml"] = html |
| 665 | } |
| 666 | this.TplName = "manager/comments.html" |
| 667 | } |
| 668 | |
| 669 | func (this *ManagerController) ClearComments() { |
| 670 | uid, _ := this.GetInt("uid") |
no test coverage detected