diff --git a/module/bug/model.php b/module/bug/model.php index 585cd03478..27c7321214 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2097,38 +2097,6 @@ class bugModel extends model ->fetchPairs(); } - /** - * 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, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG)->alias('t1') - ->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id') - ->where('t1.product')->in($productIDList) - ->beginIF($this->app->tab !== 'qa')->andWhere('t1.execution')->in(array_keys($executions))->fi() - ->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. * diff --git a/module/bug/test/bug.class.php b/module/bug/test/bug.class.php index e0f4d15ea1..fcaf342abc 100644 --- a/module/bug/test/bug.class.php +++ b/module/bug/test/bug.class.php @@ -2018,37 +2018,6 @@ class bugTest } } - /** - * Test get bugs to review. - * - * @param array $productIDList - * @param int|string $branch - * @param array $modules - * @param array $executions - * @param string $orderBy - * @access public - * @return string - */ - public function getReviewBugsTest($productIDList, $branch, $modules, $executions, $orderBy) - { - $bugs = $this->objectModel->getReviewBugs($productIDList, $branch, $modules, $executions, $orderBy); - $ids = ''; - foreach($bugs as $bug) - { - $ids .= ",$bug->id"; - } - $ids = trim($ids, ','); - - if(dao::isError()) - { - return dao::getError(); - } - else - { - return $ids; - } - } - /** * Test get related objects id lists. * diff --git a/module/bug/test/model/getreviewbugs.php b/module/bug/test/model/getreviewbugs.php deleted file mode 100755 index 3b744957f4..0000000000 --- a/module/bug/test/model/getreviewbugs.php +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env php -getReviewBugs(); -cid=1 -pid=1 - - - -*/ - -$productIDList = array('1,2,3,1000001', '1,3'); -$branch = array('all', '1'); -$moduleIDList = array('1821,1825,1832,1000001', '1821, 1825'); -$executions = array(array(101,102), array(101,111)); -$orderBy = 'id_asc'; - -$bug=new bugTest(); - -r($bug->getReviewBugsTest($productIDList[0], $branch[0], $moduleIDList[0], $executions[0], $orderBy)) && p('') && e(''); // 查询产品1 2 3 不存在的产品10001 与分支all 模块1821, 1825, 1832 不存在的模块1000001 执行101 102下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[0], $branch[1], $moduleIDList[0], $executions[0], $orderBy)) && p('') && e(''); // 查询产品1 2 3 不存在的产品10001 与分支1 模块1821, 1825, 1832 不存在的模块1000001 执行101 102下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[0], $branch[0], $moduleIDList[1], $executions[0], $orderBy)) && p('') && e(''); // 查询产品1 2 3 不存在的产品10001 与分支all 模块1821, 1825 执行101 102下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[0], $branch[1], $moduleIDList[1], $executions[0], $orderBy)) && p('') && e(''); // 查询产品1 2 3 不存在的产品10001 与分支1 模块1821, 1825 执行101 102下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[0], $branch[0], $moduleIDList[0], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 2 3 不存在的产品10001 与分支all 模块1821, 1825, 1832 不存在的模块1000001 执行101 111下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[0], $branch[1], $moduleIDList[0], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 2 3 不存在的产品10001 与分支1 模块1821, 1825, 1832 不存在的模块1000001 执行101 111下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[0], $branch[0], $moduleIDList[1], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 2 3 不存在的产品10001 与分支all 模块1821, 1825 执行101 111下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[0], $branch[1], $moduleIDList[1], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 2 3 不存在的产品10001 与分支1 模块1821, 1825 执行101 111下审批人为当前用户的bug -// -r($bug->getReviewBugsTest($productIDList[1], $branch[0], $moduleIDList[0], $executions[0], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支all 模块1821, 1825, 1832 不存在的模块1000001 执行101 102下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[1], $branch[1], $moduleIDList[0], $executions[0], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支1 模块1821, 1825, 1832 不存在的模块1000001 执行101 102下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[1], $branch[0], $moduleIDList[1], $executions[0], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支all 模块1821, 1825 执行101 102下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[1], $branch[1], $moduleIDList[1], $executions[0], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支1 模块1821, 1825 执行101 102下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[1], $branch[0], $moduleIDList[0], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支all 模块1821, 1825, 1832 不存在的模块1000001 执行101 111下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[1], $branch[1], $moduleIDList[0], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支1 模块1821, 1825, 1832 不存在的模块1000001 执行101 111下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[1], $branch[0], $moduleIDList[1], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支all 模块1821, 1825 执行101 111下审批人为当前用户的bug -r($bug->getReviewBugsTest($productIDList[1], $branch[1], $moduleIDList[1], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支1 模块1821, 1825 执行101 111下审批人为当前用户的bug \ No newline at end of file