Exemplo n.º 1
0
func (c *MainController) Weekly() {
	method := "Weekly"

	c.Data["Website"] = "tenxcloud.com"
	c.Data["Email"] = "*****@*****.**"
	c.TplNames = "weekly.tpl"

	id, _ := strconv.Atoi(c.Ctx.Input.Param(":Id"))

	//fmt.Println(id)
	if id == 0 {
		articles, err := models.SearchArticles()
		if err != nil {
			beego.Error("Error", method, err)
		}
		id = articles[0].Number
	}
	apps, err := models.QueryApps(id)
	article, err := models.QueryArticle(id)
	if err != nil {
		beego.Error("Error", method, err)
	}
	//fmt.Println(article[0])
	c.Data["apps"] = apps
	c.Data["article"] = article[0]
}
Exemplo n.º 2
0
func (c *IssueController) Get() {
	method := "IssueController"

	c.TplNames = "issues.tpl"
	articles, err := models.SearchArticles()

	if err != nil {
		beego.Error("Error", method, err)
	}
	//tm2, _ := time.Parse("2006-01-02", &articles[0].created)
	//fmt.Println(articles)

	c.Data["articles"] = articles
}