mirror of
https://github.com/strapi/strapi.git
synced 2025-11-11 15:49:50 +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;
|
break;
|
||||||
}
|
}
|
||||||
case 'count': {
|
case 'count': {
|
||||||
const dbColumnName =
|
const dbColumnName = this.aliasColumn(helpers.toColumnName(meta, 'id'));
|
||||||
state.count === '*' ? '*' : this.aliasColumn(helpers.toColumnName(meta, state.count));
|
qb.countDistinct({ count: dbColumnName });
|
||||||
|
|
||||||
qb.count({ count: dbColumnName });
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'max': {
|
case 'max': {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user