Yii Pagination Result using CSqlDataProvider
问题 I am using pagination with CSqlDataProvider. Result is shown properly for the first 20 or first page of the pagination. When I see the Log message on the web page the query it uses is actually selecting top 20 rows for all the pages and that's the problem. I have no idea how to correct it. My controller has code: public function actionLink() { $sql = "SELECT Ordernumber, Order_Date FROM [Orders] WHERE CAST(Order_Date As Date) BETWEEN '01-01-2014' AND '31-01-2014'"; $count = Yii::app()->db-