developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #1010: distinct.patch

File distinct.patch, 717 bytes (added by doubleface, 11 years ago)
  • lib/jelix/dao/jDaoFactoryBase.class.php

    diff -r a6cd6b2b64f3 lib/jelix/dao/jDaoFactoryBase.class.php
    a b  
    270270        if ($distinct !== null) {
    271271            $props = $this->getProperties();
    272272            if (isset($props[$distinct]))
    273                 $count = 'DISTINCT '.$this->_tables[$props[$distinct]['table']]['realname'].'.'.$props[$distinct]['fieldName'];
     273                $count = 'DISTINCT '.$this->_tables[$props[$distinct]['table']]['name'].'.'.$props[$distinct]['fieldName'];
    274274        }
    275275
    276276        $query = 'SELECT COUNT('.$count.') as c '.$this->_fromClause.$this->_whereClause;