* fix bug: Can not get correct data by 'byModule' or 'byProduct' browse type when browse tasks and stories in project module.

This commit is contained in:
chenfeiCF
2016-06-27 16:19:48 +08:00
parent dd1d6d1656
commit bfba4d244f
4 changed files with 15 additions and 10 deletions
+2 -1
View File
@@ -858,7 +858,7 @@ class taskModel extends model
* @access public
* @return array
*/
public function getProjectTasks($projectID, $type = 'all', $modules = 0, $orderBy = 'status_asc, id_desc', $pager = null)
public function getProjectTasks($projectID, $productID = 0, $type = 'all', $modules = 0, $orderBy = 'status_asc, id_desc', $pager = null)
{
if(is_string($type)) $type = strtolower($type);
$tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName')
@@ -867,6 +867,7 @@ class taskModel extends model
->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account')
->where('t1.project')->eq((int)$projectID)
->andWhere('t1.deleted')->eq(0)
->beginIF($productID)->andWhere('t2.product')->eq((int)$productID)->fi()
->beginIF($type == 'undone')->andWhere("(t1.status = 'wait' or t1.status ='doing')")->fi()
->beginIF($type == 'needconfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->fi()
->beginIF($type == 'assignedtome')->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi()