|
|
@ -1011,10 +1011,7 @@ class BaseModelSqlv2 { |
|
|
|
) |
|
|
|
) |
|
|
|
.from(count.as(getAlias())); |
|
|
|
.from(count.as(getAlias())); |
|
|
|
selectors.push( |
|
|
|
selectors.push( |
|
|
|
this.dbDriver.raw(`(??) as "??"`, [ |
|
|
|
this.dbDriver.raw(`(??) as ??`, [subQuery, `${f.alias}`]), |
|
|
|
subQuery, |
|
|
|
|
|
|
|
this.dbDriver.raw(f.alias), |
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'mysql2': |
|
|
|
case 'mysql2': |
|
|
@ -1391,10 +1388,7 @@ class BaseModelSqlv2 { |
|
|
|
) |
|
|
|
) |
|
|
|
.from(tQb.as(getAlias())); |
|
|
|
.from(tQb.as(getAlias())); |
|
|
|
selectors.push( |
|
|
|
selectors.push( |
|
|
|
this.dbDriver.raw(`(??) as "??"`, [ |
|
|
|
this.dbDriver.raw(`(??) as ??`, [subQuery, `${f.alias}`]), |
|
|
|
subQuery, |
|
|
|
|
|
|
|
this.dbDriver.raw(f.alias), |
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'mysql2': |
|
|
|
case 'mysql2': |
|
|
@ -1597,12 +1591,7 @@ class BaseModelSqlv2 { |
|
|
|
|
|
|
|
|
|
|
|
tQb.select(jsonBuildObject); |
|
|
|
tQb.select(jsonBuildObject); |
|
|
|
|
|
|
|
|
|
|
|
selectors.push( |
|
|
|
selectors.push(this.dbDriver.raw(`(??) as ??`, [tQb, `${f.alias}`])); |
|
|
|
this.dbDriver.raw(`(??) as ??`, [ |
|
|
|
|
|
|
|
tQb, |
|
|
|
|
|
|
|
this.dbDriver.raw(`"${f.alias}"`), |
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
qb.select(...selectors); |
|
|
|
qb.select(...selectors); |
|
|
|