Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into importExport

This commit is contained in:
tanghucheng
2022-08-04 14:10:36 +08:00
143 changed files with 1544 additions and 762 deletions
+33
View File
@@ -401,6 +401,7 @@ class bugModel extends model
elseif($browseType == 'bysearch') $bugs = $this->getBySearch($productIDList, $branch, $queryID, $sort, '', $pager, $projectID);
elseif($browseType == 'overduebugs') $bugs = $this->getOverdueBugs($productIDList, $branch, $modules, $executions, $sort, $pager, $projectID);
elseif($browseType == 'assignedbyme') $bugs = $this->getByAssignedbyme($productIDList, $branch, $modules, $executions, $sort, $pager, $projectID);
elseif($browseType == 'review') $bugs = $this->getReviewBugs($productIDList, $branch, $modules, $executions, $sort, $pager, $projectID);
return $this->checkDelayedBugs($bugs);
}
@@ -2902,6 +2903,38 @@ class bugModel extends model
return $bugs;
}
/**
* Get bugs to review.
*
* @param array $productIDList
* @param int|string $branch
* @param array $modules
* @param array $executions
* @param string $orderBy
* @param object $pager
* @param int $projectID
* @access public
* @return array
*/
public function getReviewBugs($productIDList, $branch, $modules, $executions, $orderBy, $pager = null, $projectID = 0)
{
$bugs = $this->dao->select('t1.*, t2.title as planTitle')->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id')
->where('t1.product')->in($productIDList)
->andWhere('t1.execution')->in(array_keys($executions))
->beginIF($branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($modules)->andWhere('t1.module')->in($modules)->fi()
->beginIF($projectID)->andWhere('t1.project')->eq($projectID)->fi()
->andWhere('t1.deleted')->eq(0)
->andWhere("FIND_IN_SET('{$this->app->user->account}', t1.reviewers)")
->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in('0,' . $this->app->user->view->projects)->fi()
->orderBy($orderBy)->page($pager)->fetchAll();
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug');
return $bugs;
}
/**
* Get bug query.
*