mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 19:36:20 +00:00
count columns based on distinct ID
This commit is contained in:
parent
b511597ea2
commit
b218ec3997
@ -301,10 +301,8 @@ const createQueryBuilder = (uid, db) => {
|
||||
break;
|
||||
}
|
||||
case 'count': {
|
||||
const dbColumnName =
|
||||
state.count === '*' ? '*' : this.aliasColumn(helpers.toColumnName(meta, state.count));
|
||||
|
||||
qb.count({ count: dbColumnName });
|
||||
const dbColumnName = this.aliasColumn(helpers.toColumnName(meta, 'id'));
|
||||
qb.countDistinct({ count: dbColumnName });
|
||||
break;
|
||||
}
|
||||
case 'max': {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user