()
| 564 | } |
| 565 | |
| 566 | func (this *CommonController) Categories() { |
| 567 | |
| 568 | model := models.NewCategory() |
| 569 | |
| 570 | pid, err := this.GetInt("pid") |
| 571 | if err != nil { |
| 572 | pid = -1 |
| 573 | } |
| 574 | m := models.NewOption() |
| 575 | categories, _ := model.GetCates(pid, 1) |
| 576 | for idx, category := range categories { |
| 577 | if m.IsResponseEmptyForAPP(this.Version, category.Title) { |
| 578 | // 为0,APP端就不会显示该分类 |
| 579 | category.Cnt = 0 |
| 580 | } |
| 581 | if category.Icon != "" { |
| 582 | if category.Icon == "" { |
| 583 | category.Icon = "/static/images/cate.png" |
| 584 | } |
| 585 | category.Icon = this.completeLink(category.Icon) |
| 586 | categories[idx] = category |
| 587 | } |
| 588 | } |
| 589 | |
| 590 | this.Response(http.StatusOK, messageSuccess, map[string]interface{}{"categories": categories}) |
| 591 | } |
| 592 | |
| 593 | // 【OK】 |
| 594 | func (this *CommonController) BookInfo() { |
nothing calls this directly
no test coverage detected