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