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

Function UpdateByIds

models/Models.go:159–163  ·  view source on GitHub ↗

根据指定的表和id条件更新表字段,不支持批量更新 @param table 需要更新的表 @param field 需要更新的字段 @param value 需要更新的字段的值 @param id id条件 @return affected 影响的记录数 @return err

(table string, field string, value interface{}, id ...interface{})

Source from the content-addressed store, hash-verified

157//@return affected 影响的记录数
158//@return err 错误
159func UpdateByIds(table string, field string, value interface{}, id ...interface{}) (affected int64, err error) {
160 return orm.NewOrm().QueryTable(getTable(table)).Filter("Id__in", id...).Update(orm.Params{
161 field: value,
162 })
163}
164
165//根据指定的表和id条件更新表字段,不支持批量更新
166//@param table 需要更新的表

Callers 1

RemoveToRecycleMethod · 0.85

Calls 2

getTableFunction · 0.85
UpdateMethod · 0.80

Tested by

no test coverage detected