开发者

Zend framework paginator distinct

开发者 https://www.devze.com 2023-02-03 14:23 出处:网络
If I have a query like: SELECT DISTINCT unnest(test) AS \"test\" FROM table ORDER BY \"onderwerp\" ASC LIMIT 10

If I have a query like:

SELECT DISTINCT unnest(test) AS "test" FROM table ORDER BY "onderwerp" ASC LIMIT 10

The amount of pages is never right as it will add another query:

SELECT COUNT(1) AS "zend_paginator_row_count" F开发者_StackOverflow社区ROM table

What is the best way to get the right amount of pages with a distinct query?


From http://framework.zend.com/manual/en/zend.paginator.usage.html (the The DbSelect and DbTableSelect adapter section), you can specify the query to use to get the count.

$adapter->setRowCount(<a new query to get just the count>);

0

精彩评论

暂无评论...
验证码 换一张
取 消