mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 08:00:54 +00:00
fix #440
This commit is contained in:
parent
20cfece1ab
commit
ef79a2b484
@ -461,6 +461,8 @@ func (d *dbBase) deleteRels(q dbQuerier, mi *modelInfo, args []interface{}, tz *
|
|||||||
|
|
||||||
func (d *dbBase) DeleteBatch(q dbQuerier, qs *querySet, mi *modelInfo, cond *Condition, tz *time.Location) (int64, error) {
|
func (d *dbBase) DeleteBatch(q dbQuerier, qs *querySet, mi *modelInfo, cond *Condition, tz *time.Location) (int64, error) {
|
||||||
tables := newDbTables(mi, d.ins)
|
tables := newDbTables(mi, d.ins)
|
||||||
|
tables.skipEnd = true
|
||||||
|
|
||||||
if qs != nil {
|
if qs != nil {
|
||||||
tables.parseRelated(qs.related, qs.relDepth)
|
tables.parseRelated(qs.related, qs.relDepth)
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ type dbTables struct {
|
|||||||
tables []*dbTable
|
tables []*dbTable
|
||||||
mi *modelInfo
|
mi *modelInfo
|
||||||
base dbBaser
|
base dbBaser
|
||||||
|
skipEnd bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *dbTables) set(names []string, mi *modelInfo, fi *fieldInfo, inner bool) *dbTable {
|
func (t *dbTables) set(names []string, mi *modelInfo, fi *fieldInfo, inner bool) *dbTable {
|
||||||
@ -221,11 +222,15 @@ func (t *dbTables) parseExprs(mi *modelInfo, exprs []string) (index, name string
|
|||||||
inner = false
|
inner = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if num == i && t.skipEnd {
|
||||||
|
} else {
|
||||||
jt, _ := t.add(names, mmi, fi, inner)
|
jt, _ := t.add(names, mmi, fi, inner)
|
||||||
jt.jtl = jtl
|
jt.jtl = jtl
|
||||||
jtl = jt
|
jtl = jt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if num == i {
|
if num == i {
|
||||||
if i == 0 || jtl == nil {
|
if i == 0 || jtl == nil {
|
||||||
index = "T0"
|
index = "T0"
|
||||||
|
Loading…
Reference in New Issue
Block a user