首页
()
| 40 | |
| 41 | //首页 |
| 42 | func (this *UserController) Index() { |
| 43 | |
| 44 | page, _ := this.GetInt("page") |
| 45 | pageSize := 10 |
| 46 | if page < 1 { |
| 47 | page = 1 |
| 48 | } |
| 49 | books, totalCount, _ := models.NewBook().FindToPager(page, pageSize, this.UcenterMember.MemberId, "", 0) |
| 50 | this.Data["Books"] = books |
| 51 | |
| 52 | if totalCount > 0 { |
| 53 | html := utils.NewPaginations(conf.RollPage, totalCount, pageSize, page, beego.URLFor("UserController.Index", ":username", this.UcenterMember.Account), "") |
| 54 | this.Data["PageHtml"] = html |
| 55 | } else { |
| 56 | this.Data["PageHtml"] = "" |
| 57 | } |
| 58 | this.Data["Total"] = totalCount |
| 59 | this.GetSeoByPage("ucenter-share", map[string]string{ |
| 60 | "title": "分享 - " + this.UcenterMember.Nickname, |
| 61 | "keywords": "用户主页," + this.UcenterMember.Nickname, |
| 62 | "description": this.Sitename + "专注于文档在线写作、协作、分享、阅读与托管,让每个人更方便地发布、分享和获得知识。", |
| 63 | }) |
| 64 | |
| 65 | this.TplName = "user/index.html" |
| 66 | } |
| 67 | |
| 68 | //收藏 |
| 69 | func (this *UserController) Collection() { |
nothing calls this directly
no test coverage detected