|
|
@ -2445,23 +2445,19 @@ class BaseModelSqlv2 { |
|
|
|
qb.orderBy('created_at'); |
|
|
|
qb.orderBy('created_at'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const nullListQb = qb.clone().whereNull(column.title); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const groupedQb = this.dbDriver.from( |
|
|
|
const groupedQb = this.dbDriver.from( |
|
|
|
this.dbDriver |
|
|
|
this.dbDriver |
|
|
|
.unionAll( |
|
|
|
.unionAll( |
|
|
|
[ |
|
|
|
[...groupingValues].map((r) => { |
|
|
|
this.isSqlite |
|
|
|
const query = qb.clone(); |
|
|
|
? this.dbDriver.select().from(nullListQb) |
|
|
|
if (r === null) { |
|
|
|
: nullListQb, |
|
|
|
query.whereNull(column.title); |
|
|
|
...[...groupingValues].map((r) => { |
|
|
|
} else { |
|
|
|
const query = qb.clone().where(column.title, r); |
|
|
|
query.where(column.title, r); |
|
|
|
|
|
|
|
} |
|
|
|
return this.isSqlite |
|
|
|
|
|
|
|
? this.dbDriver.select().from(query) |
|
|
|
return this.isSqlite ? this.dbDriver.select().from(query) : query; |
|
|
|
: query; |
|
|
|
|
|
|
|
}), |
|
|
|
}), |
|
|
|
], |
|
|
|
|
|
|
|
!this.isSqlite |
|
|
|
!this.isSqlite |
|
|
|
) |
|
|
|
) |
|
|
|
.as('__nc_grouped_list') |
|
|
|
.as('__nc_grouped_list') |
|
|
|