@@ -64,14 +64,13 @@ public function run()
64
64
if (!empty ($ originalQuery ->where )) {
65
65
$ filterQuery ->andWhere ($ originalQuery ->where );
66
66
}
67
- $ actionQuery = clone $ filterQuery ;
68
67
$ filterQuery
69
68
->offset (Yii::$ app ->request ->getQueryParam ('start ' , 0 ))
70
69
->limit (Yii::$ app ->request ->getQueryParam ('length ' , -1 ));
71
70
/* Begin of fix - serverSide pagination - get pagination from server side - Yii
72
71
$dataProvider = new ActiveDataProvider(['query' => $filterQuery, 'pagination' => false]);
73
72
*/
74
- $ dataProvider = new ActiveDataProvider (['query ' => $ actionQuery , 'pagination ' => ['pageSize ' => Yii::$ app ->request ->getQueryParam ('length ' , 10 )] ]);
73
+ $ dataProvider = new ActiveDataProvider (['query ' => $ filterQuery , 'pagination ' => ['pageSize ' => Yii::$ app ->request ->getQueryParam ('length ' , 10 )] ]);
75
74
// End of fix - serverSide pagination - get pagination from server side - Yii
76
75
Yii::$ app ->response ->format = \yii \web \Response::FORMAT_JSON ;
77
76
try {
@@ -82,7 +81,7 @@ public function run()
82
81
/* Begin of fix - get actual data from server according to filters, offset and limit
83
82
'data' => $dataProvider->getModels(),
84
83
*/
85
- 'data ' => $ actionQuery ->all (),
84
+ 'data ' => $ filterQuery ->all (),
86
85
// End of fix - get actual data from server according to filters, offset and limit
87
86
];
88
87
} catch (\Exception $ e ) {
0 commit comments