We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Given the query
$qb->select("c, u, p, a, pd, ad, GEO_DISTANCE_BY_POSTAL_CODE('GB', :postcode, 'GB', ad.outerPostcode) AS distance");
the count query fails as it strips the select clause.
quick fix for it is like this: from Ali/DatatableBundle/Util/Factory/Query/DoctrineBuilder.php:148
/** * get total records * * @return integer */ public function getTotalRecords() { $qb = clone $this->queryBuilder; $this->_addSearch($qb); $qb->resetDQLPart('orderBy'); $gb = $qb->getDQLPart('groupBy'); if (empty($gb) || !in_array($this->fields['_identifier_'], $gb)) { $qb->select(" count({$this->fields['_identifier_']}), (:postcode) distance "); return $qb->getQuery()->getSingleResult()[1]; } else { $qb->resetDQLPart('groupBy'); $qb->select(" count(distinct {$this->fields['_identifier_']}) "); return $qb->getQuery()->getSingleScalarResult(); } }
Of course it will break other datatables. I think it should be catered for in more general way. Other possible soloution - remove parameters bound.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Given the query
the count query fails as it strips the select clause.
quick fix for it is like this:
from Ali/DatatableBundle/Util/Factory/Query/DoctrineBuilder.php:148
Of course it will break other datatables.
I think it should be catered for in more general way.
Other possible soloution - remove parameters bound.
The text was updated successfully, but these errors were encountered: