示例#1
0
文件: role.go 项目: blackmady/GoCMS
//成员管理
func (c Role) Member(role *models.Role) revel.Result {
	title := "成员管理--GoCMS管理系统"

	var id string = c.Params.Get("id")
	var page string = c.Params.Get("page")

	if len(id) > 0 {
		Id, err := strconv.ParseInt(id, 10, 64)
		if err != nil {
			revel.WARN.Println(err)
		}

		where := make(map[string]string)

		admin := new(models.Admin)

		if len(page) > 0 {
			Page, err := strconv.ParseInt(page, 10, 64)
			if err != nil {
				revel.WARN.Println(err)
			}

			admin_list, pages := admin.GetByAll(Id, where, Page, 10)

			c.Render(title, admin_list, pages)
		} else {
			admin_list, pages := admin.GetByAll(Id, where, 1, 10)

			c.Render(title, admin_list, pages)
		}

	} else {
		c.Render(title)
	}

	return c.RenderTemplate("Setting/Role/Member.html")
}
示例#2
0
文件: admin.go 项目: blackmady/GoCMS
//首页
func (c Admin) Index(admin *models.Admin) revel.Result {
	title := "管理员管理--GoCMS管理系统"

	var page string = c.Params.Get("page")

	where := make(map[string]string)

	if len(page) > 0 {
		Page, err := strconv.ParseInt(page, 10, 64)
		if err != nil {
			revel.WARN.Println(err)
		}

		admin_list, pages := admin.GetByAll(0, where, Page, 10)

		c.Render(title, admin_list, pages)
	} else {
		admin_list, pages := admin.GetByAll(0, where, 1, 10)

		c.Render(title, admin_list, pages)
	}

	return c.RenderTemplate("Setting/Admin/Index.html")
}