|
|
@ -1905,6 +1905,7 @@ class BaseModelSql extends BaseModel { |
|
|
|
parents.split('~').map((parent, index) => { |
|
|
|
parents.split('~').map((parent, index) => { |
|
|
|
const { cn, rcn } = |
|
|
|
const { cn, rcn } = |
|
|
|
this.belongsToRelations.find(({ rtn }) => rtn === parent) || {}; |
|
|
|
this.belongsToRelations.find(({ rtn }) => rtn === parent) || {}; |
|
|
|
|
|
|
|
this.belongsToRelations.find(({ rtn }) => rtn === parent) || {}; |
|
|
|
const parentIds = [ |
|
|
|
const parentIds = [ |
|
|
|
...new Set(childs.map(c => c[cn] || c[this.columnToAlias[cn]])) |
|
|
|
...new Set(childs.map(c => c[cn] || c[this.columnToAlias[cn]])) |
|
|
|
]; |
|
|
|
]; |
|
|
@ -2162,7 +2163,7 @@ class BaseModelSql extends BaseModel { |
|
|
|
), |
|
|
|
), |
|
|
|
this.config.limitMin |
|
|
|
this.config.limitMin |
|
|
|
); |
|
|
|
); |
|
|
|
obj.offset = args.offset || args.o || 0; |
|
|
|
obj.offset = Math.max(+(args.offset || args.o) || 0, 0); |
|
|
|
obj.fields = args.fields || args.f || '*'; |
|
|
|
obj.fields = args.fields || args.f || '*'; |
|
|
|
obj.sort = args.sort || args.s; |
|
|
|
obj.sort = args.sort || args.s; |
|
|
|
return obj; |
|
|
|
return obj; |
|
|
|