* code for task#1043.

This commit is contained in:
zhujinyong
2013-01-06 02:44:52 +00:00
parent b073f1f57f
commit 3b9ede6473
+2 -2
View File
@@ -639,7 +639,7 @@ class taskModel extends model
* @access public
* @return array
*/
public function getUserTasks($account, $type = 'assignedto', $limit = 0, $pager = null)
public function getUserTasks($account, $type = 'assignedto', $limit = 0, $pager = null, $orderBy="id_desc")
{
$type = strtolower($type);
$tasks = $this->dao->select('t1.*, t2.id as projectID, t2.name as projectName, t3.id as storyID, t3.title as storyTitle, t3.status AS storyStatus, t3.version AS latestStoryVersion')
@@ -654,7 +654,7 @@ class taskModel extends model
->beginIF($type == 'finishedby')->andWhere('t1.finishedby')->eq($account)->fi()
->beginIF($type == 'closedby')->andWhere('t1.closedby')->eq($account)->fi()
->beginIF($type == 'canceledby')->andWhere('t1.canceledby')->eq($account)->fi()
->orderBy('id desc')
->orderBy($orderBy)
->beginIF($limit > 0)->limit($limit)->fi()
->page($pager)
->fetchAll();