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

Function UpdateByField

models/Models.go:172–174  ·  view source on GitHub ↗

根据指定的表和id条件更新表字段,不支持批量更新 @param table 需要更新的表 @param data 需要更新的字段 @param filter 过滤条件,如"Id__in" @param filterValue 过滤条件的值 @return affected 影响的记录数 @return err

(table string, data map[string]interface{}, filter string, filterValue ...interface{})

Source from the content-addressed store, hash-verified

170//@return affected 影响的记录数
171//@return err 错误
172func UpdateByField(table string, data map[string]interface{}, filter string, filterValue ...interface{}) (affected int64, err error) {
173 return orm.NewOrm().QueryTable(getTable(table)).Filter(filter, filterValue...).Update(data)
174}
175
176//设置字段值减小
177//@param table 需要操作的数据表

Callers

nothing calls this directly

Calls 2

getTableFunction · 0.85
UpdateMethod · 0.80

Tested by

no test coverage detected