bug: user update by multifields, param need '...' (#1170)
bug: 多字段更新用户时,参数作为slice接受,需要拆包之后再往下传入。该bug导致user.Update方法只能成功更新第一个参数对应的字段
This commit is contained in:
parent
ee07969c8a
commit
562f98ddaf
|
@ -95,7 +95,7 @@ func (u *User) Update(selectField interface{}, selectFields ...interface{}) erro
|
|||
return err
|
||||
}
|
||||
|
||||
return DB().Model(u).Select(selectField, selectFields).Updates(u).Error
|
||||
return DB().Model(u).Select(selectField, selectFields...).Updates(u).Error
|
||||
}
|
||||
|
||||
func (u *User) UpdateAllFields() error {
|
||||
|
|
Loading…
Reference in New Issue