SEO管理
()
| 817 | |
| 818 | // SEO管理 |
| 819 | func (this *ManagerController) Seo() { |
| 820 | o := orm.NewOrm() |
| 821 | if this.Ctx.Input.IsPost() { //SEO更新 |
| 822 | rows, err := o.QueryTable(models.TableSeo).Filter("id", this.GetString("id")).Update(map[string]interface{}{ |
| 823 | this.GetString("field"): this.GetString("value"), |
| 824 | }) |
| 825 | if err != nil { |
| 826 | beego.Error(err.Error()) |
| 827 | this.JsonResult(1, "更新失败,请求错误") |
| 828 | } |
| 829 | if rows > 0 { |
| 830 | this.JsonResult(0, "更新成功") |
| 831 | } |
| 832 | this.JsonResult(1, "更新失败,您未对内容做更改") |
| 833 | } |
| 834 | |
| 835 | //SEO展示 |
| 836 | var seos []models.Seo |
| 837 | o.QueryTable(models.TableSeo).All(&seos) |
| 838 | this.Data["Lists"] = seos |
| 839 | this.Data["IsManagerSeo"] = true |
| 840 | this.TplName = "manager/seo.html" |
| 841 | } |
| 842 | |
| 843 | func (this *ManagerController) UpdateAds() { |
| 844 | id, _ := this.GetInt("id") |
nothing calls this directly
no test coverage detected