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