Exemple #1
0
func (c Focus) Index(focus *models.Focus) revel.Result {

	title := "焦点图列表--GoCMS管理系统"

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

	FocusCate := new(models.FocusCate)
	Cate_list := FocusCate.GetCateList()

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

		focus_list, pages, where := focus.GetByAll(search, Page, 10)

		c.Render(title, focus_list, Cate_list, where, pages)
	} else {
		focus_list, pages, where := focus.GetByAll(search, 1, 10)

		c.Render(title, focus_list, Cate_list, where, pages)
	}

	return c.RenderTemplate("Content/Focus/Index.html")
}