用户列表.
()
| 84 | |
| 85 | // 用户列表. |
| 86 | func (this *ManagerController) Users() { |
| 87 | this.TplName = "manager/users.html" |
| 88 | this.Data["IsUsers"] = true |
| 89 | wd := this.GetString("wd") |
| 90 | role, err := this.GetInt("role") |
| 91 | if err != nil { |
| 92 | role = -1 |
| 93 | } |
| 94 | pageIndex, _ := this.GetInt("page", 0) |
| 95 | this.GetSeoByPage("manage_users", map[string]string{ |
| 96 | "title": "用户管理 - " + this.Sitename, |
| 97 | "keywords": "用户管理", |
| 98 | "description": this.Sitename + "专注于文档在线写作、协作、分享、阅读与托管,让每个人更方便地发布、分享和获得知识。", |
| 99 | }) |
| 100 | |
| 101 | members, totalCount, err := models.NewMember().FindToPager(pageIndex, conf.PageSize, wd, role) |
| 102 | |
| 103 | if err != nil { |
| 104 | this.Data["ErrorMessage"] = err.Error() |
| 105 | return |
| 106 | } |
| 107 | |
| 108 | if totalCount > 0 { |
| 109 | this.Data["PageHtml"] = utils.NewPaginations(conf.RollPage, int(totalCount), conf.PageSize, pageIndex, beego.URLFor("ManagerController.Users"), "") |
| 110 | } else { |
| 111 | this.Data["PageHtml"] = "" |
| 112 | } |
| 113 | |
| 114 | b, err := json.Marshal(members) |
| 115 | |
| 116 | if err != nil { |
| 117 | this.Data["Result"] = template.JS("[]") |
| 118 | } else { |
| 119 | this.Data["Result"] = template.JS(string(b)) |
| 120 | } |
| 121 | this.Data["Role"] = role |
| 122 | this.Data["Wd"] = wd |
| 123 | } |
| 124 | |
| 125 | // 标签管理. |
| 126 | func (this *ManagerController) Tags() { |
nothing calls this directly
no test coverage detected