mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 19:04:38 +00:00
only use id when state.count is *
This commit is contained in:
parent
fca84ede09
commit
2b576869b6
@ -301,7 +301,11 @@ const createQueryBuilder = (uid, db) => {
|
||||
break;
|
||||
}
|
||||
case 'count': {
|
||||
const dbColumnName = this.aliasColumn(helpers.toColumnName(meta, 'id'));
|
||||
const dbColumnName =
|
||||
state.count === '*'
|
||||
? this.aliasColumn(helpers.toColumnName(meta, 'id'))
|
||||
: this.aliasColumn(helpers.toColumnName(meta, state.count));
|
||||
|
||||
qb.countDistinct({ count: dbColumnName });
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user