+ add limit param to the getList() method.
This commit is contained in:
@@ -211,15 +211,17 @@ class projectModel extends model
|
|||||||
* Get project lists.
|
* Get project lists.
|
||||||
*
|
*
|
||||||
* @param string $status
|
* @param string $status
|
||||||
|
* @param int $limit
|
||||||
* @access public
|
* @access public
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getList($status = 'all')
|
public function getList($status = 'all', $limit = 0)
|
||||||
{
|
{
|
||||||
return $this->dao->select('*')->from(TABLE_PROJECT)->where('iscat')->eq(0)
|
return $this->dao->select('*')->from(TABLE_PROJECT)->where('iscat')->eq(0)
|
||||||
->beginIF($status != 'all')->andWhere('status')->in($status)->fi()
|
->beginIF($status != 'all')->andWhere('status')->in($status)->fi()
|
||||||
->andWhere('deleted')->eq(0)
|
->andWhere('deleted')->eq(0)
|
||||||
->orderBy('status, end DESC')
|
->orderBy('status, end DESC')
|
||||||
|
->beginIF($limit)->limit($limit)->fi()
|
||||||
->fetchAll();
|
->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user