单页
()
| 147 | |
| 148 | //单页 |
| 149 | func (this *BaseController) Pages() { |
| 150 | alias := this.GetString(":page") |
| 151 | page, err := models.NewPages().One(alias) |
| 152 | if err != nil { |
| 153 | helper.Logger.Error(err.Error()) |
| 154 | this.Abort("404") |
| 155 | } |
| 156 | if page.Id == 0 || page.Status == false { |
| 157 | this.Abort("404") |
| 158 | } |
| 159 | this.Data["Seo"] = models.NewSeo().GetByPage("PC-Pages", page.Title, page.Keywords, page.Description, this.Sys.Site) |
| 160 | page.Vcnt += 1 |
| 161 | orm.NewOrm().Update(&page, "Vcnt") |
| 162 | cs, _ := models.NewCloudStore(false) |
| 163 | page.Content = cs.ImageWithDomain(page.Content) |
| 164 | |
| 165 | this.Data["Page"] = page |
| 166 | this.Data["Lists"], _, _ = models.NewPages().List(20, 1) |
| 167 | this.Data["PageId"] = "wenku-content" |
| 168 | this.TplName = "pages.html" |
| 169 | } |
nothing calls this directly
no test coverage detected