bug: user update by multifields, param need '...' (#1170)

bug: 多字段更新用户时,参数作为slice接受,需要拆包之后再往下传入。该bug导致user.Update方法只能成功更新第一个参数对应的字段
This commit is contained in:
gengleiming 2022-09-26 14:45:58 +08:00 committed by GitHub
parent ee07969c8a
commit 562f98ddaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ func (u *User) Update(selectField interface{}, selectFields ...interface{}) erro
return err 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 { func (u *User) UpdateAllFields() error {