根据指定的表和id条件更新表字段,不支持批量更新 @param table 需要更新的表 @param field 需要更新的字段 @param value 需要更新的字段的值 @param id id条件 @return affected 影响的记录数 @return err
(table string, field string, value interface{}, id ...interface{})
| 157 | //@return affected 影响的记录数 |
| 158 | //@return err 错误 |
| 159 | func 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 需要更新的表 |
no test coverage detected