更新内容
()
| 110 | |
| 111 | //更新内容 |
| 112 | func (this *BaseController) Update() { |
| 113 | id := strings.Split(this.GetString("id"), ",") |
| 114 | i, err := models.UpdateByIds(this.GetString("table"), this.GetString("field"), this.GetString("value"), id) |
| 115 | ret := map[string]interface{}{"status": 0, "msg": "更新失败,可能您未对内容作更改"} |
| 116 | if i > 0 && err == nil { |
| 117 | ret["status"] = 1 |
| 118 | ret["msg"] = "更新成功" |
| 119 | } |
| 120 | if err != nil { |
| 121 | ret["msg"] = err.Error() |
| 122 | } |
| 123 | this.Data["json"] = ret |
| 124 | this.ServeJSON() |
| 125 | } |
| 126 | |
| 127 | //删除内容 |
| 128 | func (this *BaseController) Del() { |
no outgoing calls
no test coverage detected