diff --git a/module/personnel/model.php b/module/personnel/model.php index f1f0fa277b..038d358410 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -313,19 +313,20 @@ class personnelModel extends model } /** + * 获取项目下的迭代或阶段。 * Gets the iteration or phase under the project. * - * @param object $projects + * @param array $projects * @access public * @return array */ - public function getInvolvedExecutions($projects) + public function getInvolvedExecutions(array $projects): array { - $executions = $this->dao->select('id')->from(TABLE_PROJECT) + $executions = $this->dao->select('id,id')->from(TABLE_PROJECT) ->where('type')->in('stage,sprint') ->andWhere('project')->in(array_keys($projects)) ->andWhere('deleted')->eq('0') - ->fetchPairs('id'); + ->fetchPairs(); return $this->dao->select('account, count(root) as executions')->from(TABLE_TEAM) ->where('root')->in(array_keys($executions)) diff --git a/module/personnel/test/model/getinvolvedexecutions.php b/module/personnel/test/model/getinvolvedexecutions.php index a95027e3d3..f7a65fe102 100755 --- a/module/personnel/test/model/getinvolvedexecutions.php +++ b/module/personnel/test/model/getinvolvedexecutions.php @@ -1,5 +1,6 @@ #!/usr/bin/env php getInvolvedExecutionsTest($project[0])); $result2 = $personnel->getInvolvedExecutionsTest($project[0]); diff --git a/module/personnel/test/personnel.class.php b/module/personnel/test/personnel.class.php index 23d9527158..443b9ca22b 100644 --- a/module/personnel/test/personnel.class.php +++ b/module/personnel/test/personnel.class.php @@ -151,16 +151,17 @@ class personnelTest } /** - * Get involved executions test + * 测试获取项目下的迭代或阶段。 + * Test get the iteration or phase under the project. * - * @param array $projectID + * @param array $projects * @access public * @return array */ - public function getInvolvedExecutionsTest($projectID) + public function getInvolvedExecutionsTest(array $projects): array { global $tester; - $project = $tester->dao->select('id')->from(TABLE_PROJECT)->where('id')->in($projectID)->fetchall('id'); + $project = $tester->dao->select('id')->from(TABLE_PROJECT)->where('id')->in($projects)->fetchAll('id'); $objects = $this->objectModel->getInvolvedExecutions($project); if(dao::isError()) return dao::getError();