Skip to content
New issue

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

Phalcon\Paginator\Adapter\QueryBuilder groupBy #2698

Closed
cq-z opened this issue Aug 12, 2014 · 1 comment
Closed

Phalcon\Paginator\Adapter\QueryBuilder groupBy #2698

cq-z opened this issue Aug 12, 2014 · 1 comment

Comments

@cq-z
Copy link
Contributor

cq-z commented Aug 12, 2014

Phalcon\Paginator\Adapter\QueryBuilder Cannot use groupBy () 。Otherwise page is error

i do
$count="count(*) as count";
if(!empty($builder->getGroupBy ())){
$count='count(DISTINCT '.$builder->getGroupBy ().') as count';
}
$totalItems=$builder->columns($count)
->groupBy(null)->getQuery()->execute()->toArray();
$this->total_items=current(current($totalItems));

@cq-z cq-z closed this as completed Aug 14, 2014
@cq-z
Copy link
Contributor Author

cq-z commented Aug 14, 2014

#2065
#2411

@phalcon phalcon changed the title Phalcon\Paginator\Adapter\QueryBuilder groupBy Phalcon\Paginator\Adapter\QueryBuilder groupBy Sep 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant