File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ $query = $this->db->where('type', 'C');
7474$countQuery = clone $query;
7575
7676// Get total count from cloned query
77+ // Or you could use count_all_results('', false) to keep query instead of using `clone`
7778$count = $countQuery->count_all_results();
7879
7980// Initialize a Data Pagination with previous count number
@@ -356,7 +357,8 @@ $query = $this->Post_model->find()
356357$countQuery = clone $query;
357358
358359// Get total count from cloned query
359- $count = $countQuery->count_all_results();
360+ // Or you could use count(false) to keep query instead of using `clone`
361+ $count = $countQuery->count();
360362
361363// Initialize a Data Pagination with previous count number
362364$pagination = new \yidas\data\Pagination([
Original file line number Diff line number Diff line change @@ -195,6 +195,19 @@ public function run()
195195 }
196196 }
197197 }
198+ elseif ($ this ->pagination ->pageCount < 1 ) {
199+
200+ // Empty
201+ $ this ->_buttonStack [] = 1 ;
202+ }
203+ else {
204+
205+ // Under count number
206+ for ($ i =1 ; $ i <= $ this ->pagination ->pageCount ; $ i ++) {
207+
208+ $ this ->_buttonStack [] = $ i ;
209+ }
210+ }
198211
199212 // Link Attributes to html string
200213 $ linkAttributes = '' ;
You can’t perform that action at this time.
0 commit comments