示例#1
0
//添加相关文章
func (c Content) Relationlist(article *models.Article) revel.Result {
	title := "内容--添加相关文章"

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

	//栏目信息
	category := new(models.Category)
	category_info := category.GetCateGoryOptionHtml(0)

	var Page int64 = 1

	if len(page) > 0 {
		Page, _ = strconv.ParseInt(page, 10, 64)
	}

	Cid, err := strconv.ParseInt(cid, 10, 64)
	if err != nil {
		revel.WARN.Println(err)
	}

	article_list, pages, where := article.GetByList(Cid, search, Page, 10)

	c.Render(title, cid, category_info, article_list, pages, where)
	return c.RenderTemplate("Content/Manage/Relationlist.html")
}