1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 02:10:49 +00:00

Merge pull request #7 from flycash/fix4734-1x

Fix 4734: we don't need to reset the id to 0
This commit is contained in:
Ming Deng 2021-08-19 21:52:16 +08:00 committed by GitHub
commit 34334a52be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,13 +242,7 @@ func (o *orm) Update(md interface{}, cols ...string) (int64, error) {
func (o *orm) Delete(md interface{}, cols ...string) (int64, error) {
mi, ind := o.getMiInd(md, true)
num, err := o.alias.DbBaser.Delete(o.db, mi, ind, o.alias.TZ, cols)
if err != nil {
return num, err
}
if num > 0 {
o.setPk(mi, ind, 0)
}
return num, nil
return num, err
}
// create a models to models queryer