MCPcopy Index your code
hub / github.com/TruthHun/BookStack / UpdateByField

Method UpdateByField

models/category.go:106–109  ·  view source on GitHub ↗

根据字段更新内容

(id int, field, val string)

Source from the content-addressed store, hash-verified

104
105//根据字段更新内容
106func (this *Category) UpdateByField(id int, field, val string) (err error) {
107 _, err = orm.NewOrm().QueryTable(tableCategory).Filter("id", id).Update(orm.Params{field: val})
108 return
109}
110
111//查询单个分类
112func (this *Category) Find(id int) (cate Category) {

Callers 2

UpdateCateMethod · 0.80
UpdateCateIconMethod · 0.80

Calls 1

UpdateMethod · 0.45

Tested by

no test coverage detected