row, err := session.Cols("a").Update(request, models.m{UserId: request.UserId})
a列要更改为int 0时,这样写,update第一个参数是更改的值,第二个参数是约束条件:
// Update records, bean's non-empty fields are updated contents, // condiBean' non-empty filds are conditions // CAUTION: // 1.bool will defaultly be updated content nor conditions // You should call UseBool if you have bool to use. // 2.float32 & float64 may be not inexact as conditions func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int64, error) {