Skip to content

Commit ba8c0a7

Browse files
committed
Update CRUDControllerUtilitiesTrait.php
1 parent c1bb5d8 commit ba8c0a7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Ubiquity/controllers/crud/CRUDControllerUtilitiesTrait.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ protected function getInstances(&$totalCount,$page=1,$id=null){
3636
$totalCount=DAO::count($model,$condition);
3737
if($totalCount){
3838
$recordsPerPage=$this->_getModelViewer()->recordsPerPage($model,$totalCount);
39-
}
40-
if(is_numeric($recordsPerPage)){
41-
if(isset($id)){
42-
$rownum=DAO::getRownum($model, $id);
43-
$this->activePage=Pagination::getPageOfRow($rownum,$recordsPerPage);
39+
if(is_numeric($recordsPerPage)){
40+
if(isset($id)){
41+
$rownum=DAO::getRownum($model, $id);
42+
$this->activePage=Pagination::getPageOfRow($rownum,$recordsPerPage);
43+
}
44+
return DAO::paginate($model,$this->activePage,$recordsPerPage,$condition);
4445
}
45-
return DAO::paginate($model,$this->activePage,$recordsPerPage,$condition);
4646
}
4747
return DAO::getAll($model,$condition);
4848
}

0 commit comments

Comments
 (0)