|
|
@ -523,6 +523,7 @@ class BaseModelSqlv2 { |
|
|
|
model: childTable |
|
|
|
model: childTable |
|
|
|
}); |
|
|
|
}); |
|
|
|
const rtn = childTable.table_name; |
|
|
|
const rtn = childTable.table_name; |
|
|
|
|
|
|
|
const rtnId = childTable.id; |
|
|
|
|
|
|
|
|
|
|
|
const qb = this.dbDriver(rtn).join(vtn, `${vtn}.${vrcn}`, `${rtn}.${rcn}`); |
|
|
|
const qb = this.dbDriver(rtn).join(vtn, `${vtn}.${vrcn}`, `${rtn}.${rcn}`); |
|
|
|
|
|
|
|
|
|
|
@ -551,7 +552,10 @@ class BaseModelSqlv2 { |
|
|
|
|
|
|
|
|
|
|
|
const children = await finalQb; |
|
|
|
const children = await finalQb; |
|
|
|
const proto = await ( |
|
|
|
const proto = await ( |
|
|
|
await Model.getBaseModelSQL({ table_name: rtn, dbDriver: this.dbDriver }) |
|
|
|
await Model.getBaseModelSQL({ |
|
|
|
|
|
|
|
id: rtnId, |
|
|
|
|
|
|
|
dbDriver: this.dbDriver |
|
|
|
|
|
|
|
}) |
|
|
|
).getProto(); |
|
|
|
).getProto(); |
|
|
|
const gs = _.groupBy( |
|
|
|
const gs = _.groupBy( |
|
|
|
children.map(c => { |
|
|
|
children.map(c => { |
|
|
@ -582,6 +586,7 @@ class BaseModelSqlv2 { |
|
|
|
model: childTable |
|
|
|
model: childTable |
|
|
|
}); |
|
|
|
}); |
|
|
|
const rtn = childTable.table_name; |
|
|
|
const rtn = childTable.table_name; |
|
|
|
|
|
|
|
const rtnId = childTable.id; |
|
|
|
|
|
|
|
|
|
|
|
const qb = this.dbDriver(rtn) |
|
|
|
const qb = this.dbDriver(rtn) |
|
|
|
.join(vtn, `${vtn}.${vrcn}`, `${rtn}.${rcn}`) |
|
|
|
.join(vtn, `${vtn}.${vrcn}`, `${rtn}.${rcn}`) |
|
|
@ -600,7 +605,7 @@ class BaseModelSqlv2 { |
|
|
|
|
|
|
|
|
|
|
|
const children = await qb; |
|
|
|
const children = await qb; |
|
|
|
const proto = await ( |
|
|
|
const proto = await ( |
|
|
|
await Model.getBaseModelSQL({ table_name: rtn, dbDriver: this.dbDriver }) |
|
|
|
await Model.getBaseModelSQL({ id: rtnId, dbDriver: this.dbDriver }) |
|
|
|
).getProto(); |
|
|
|
).getProto(); |
|
|
|
|
|
|
|
|
|
|
|
return children.map(c => { |
|
|
|
return children.map(c => { |
|
|
|