diff --git a/module/execution/model.php b/module/execution/model.php index 3dd8a661ae..4012f9bf43 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3310,30 +3310,6 @@ class executionModel extends model ->fetchGroup('root', 'account'); } - /** - * Get teams which can be imported. - * - * @param string $account - * @param int $currentExecution - * @access public - * @return array - */ - public function getTeams2Import($account, $currentExecution) - { - $execution = $this->dao->findById($currentExecution)->from(TABLE_EXECUTION)->fetch(); - return $this->dao->select('t1.root, t2.name as executionName') - ->from(TABLE_TEAM)->alias('t1') - ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.root = t2.id') - ->where('t1.account')->eq($account) - ->andWhere('t1.root')->ne($currentExecution) - ->andWhere('t1.type')->eq('execution') - ->andWhere('t2.project')->eq($execution->project) - ->andWhere('t2.deleted')->eq('0') - ->groupBy('t1.root') - ->orderBy('t1.root DESC') - ->fetchPairs(); - } - /** * 获取可导入的执行成员。 * Get members of a execution who can be imported. diff --git a/module/execution/test/execution.class.php b/module/execution/test/execution.class.php index 2c5e696d35..46d694063c 100644 --- a/module/execution/test/execution.class.php +++ b/module/execution/test/execution.class.php @@ -1603,41 +1603,6 @@ class executionTest } } - /** - * function getTeams2Import test by execution - * - * @param string $account - * @param string $currentExecution - * @param string $count - * @access public - * @return array - */ - public function getTeams2ImportTest($account, $currentExecution, $count) - { - $object = $this->executionModel->getTeams2Import($account, $currentExecution); - - if(dao::isError()) - { - $error = dao::getError(); - return $error; - } - elseif($count == "1") - { - return count($object); - } - else - { - if(empty($object)) - { - return '无数据'; - } - else - { - return $object; - } - } - } - /** * function getMembers2Import test by execution * diff --git a/module/execution/test/model/getteams2import.php b/module/execution/test/model/getteams2import.php deleted file mode 100755 index dc05bdfee8..0000000000 --- a/module/execution/test/model/getteams2import.php +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env php -id->range('1-6'); -$execution->name->range('项目1,迭代1,迭代2,迭代3,迭代4,迭代5'); -$execution->type->range('project,stage,sprint,stage{2},sprint'); -$execution->parent->range('0,1{3},2{2}'); -$execution->status->range('wait'); -$execution->gen(6); - - -$team = zdTable('team'); -$team->root->range('3-5'); -$team->account->range('1-5')->prefix('user'); -$team->role->range('研发{3},测试{2}'); -$team->type->range('execution'); -$team->join->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD'); -$team->gen(5); - -zdTable('user')->gen(5); -su('admin'); - -/** - -title=测试executionModel->getTeams2ImportTest(); -cid=1 -pid=1 - -无效数据查询 >> 无数据 -正常数据查询 >> 迭代3 -正常数据查询统计 >> 1 - -*/ - -$executionID = '2'; -$accountList = array('user10', 'user5'); -$count = array('0','1'); - -$execution = new executionTest(); - -r($execution->getTeams2ImportTest($accountList[0], $executionID, $count[0])) && p() && e('无数据'); // 无效数据查询 -r($execution->getTeams2ImportTest($accountList[1], $executionID, $count[0])) && p('4') && e('迭代3'); // 正常数据查询 -r($execution->getTeams2ImportTest($accountList[1], $executionID, $count[1])) && p() && e('1'); // 正常数据查询统计