From 3b9ede6473e7998ab91d8cc80fd20e89b919f6c2 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Sun, 6 Jan 2013 02:44:52 +0000 Subject: [PATCH] * code for task#1043. --- module/task/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index d5c3f4711c..d72b166edb 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -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();