[TYPO3-mvc] Re: $query-count() bei suche mit JOIN / Sortierung deutscher Wörter
Martin Kutschker
masi-no at spam-typo3.org
Mon Aug 9 17:40:22 CEST 2010
Am 09.08.2010 10:53, schrieb Illi, Cornelius:
> I added some code to the getObjectCountByQuery() method in Typo3DbBackend.php:
>
> if( !isset($statementParts['keywords']['distinct']) ) {
> $statementParts['fields'] = array( 'COUNT(*)' );
> } else {
> $className = $query->getSource()->getNodeTypeName();
> $tableName = $this->dataMapper->getDataMap($className)->getTableName();
> $statementParts['fields'] = array( 'COUNT(DISTINCT '.$tableName.'.uid)' );
> unset( $statementParts['keywords']['distinct'] );
> }
Why is the COUNT() in the two clauses different (* vs <table>.uid)?
Masi
PS: What about the proposals to allow tables without a uid column?
More information about the TYPO3-project-typo3v4mvc
mailing list