mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 23:40:56 +00:00
ISSUE2630 使用sqlite,orm中通过filter后的delete删除不成功
https://github.com/astaxie/beego/issues/2630
This commit is contained in:
parent
83814a76cc
commit
9b01b1c63d
@ -833,7 +833,11 @@ func (d *dbBase) DeleteBatch(q dbQuerier, qs *querySet, mi *modelInfo, cond *Con
|
|||||||
if err := rs.Scan(&ref); err != nil {
|
if err := rs.Scan(&ref); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
args = append(args, reflect.ValueOf(ref).Interface())
|
pkValue, err := d.convertValueFromDB(mi.fields.pk, reflect.ValueOf(ref).Interface(), tz)
|
||||||
|
if err != nil {
|
||||||
|
panic(fmt.Errorf("get pk value failed: `%s` ", ref))
|
||||||
|
}
|
||||||
|
args = append(args, pkValue)
|
||||||
cnt++
|
cnt++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user