简体   繁体   English

Zend框架分页器与众不同

[英]Zend framework paginator distinct

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" FROM table

What is the best way to get the right amount of pages with a distinct query? 用不同的查询获取正确数量的页面的最佳方法是什么?

http://framework.zend.com/manual/en/zend.paginator.usage.html(“DbSelect和DbTableSelect适配器”部分)中,您可以指定用于获取计数的查询。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM