diff --git a/module/execution/model.php b/module/execution/model.php index 2aa988d8ad..830d4d29f8 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1680,20 +1680,21 @@ class executionModel extends model } /** - * Get project lists. + * 获取执行列表信息。 + * Get execution list information. * - * @param int $projectID - * @param string $type all|sprint|stage|kanban - * @param string $status all|undone|wait|running - * @param int $limit - * @param int $productID - * @param int $branch - * @param object $pager - * @param bool $withChildren + * @param int $projectID + * @param string $type all|sprint|stage|kanban + * @param string $status all|undone|wait|running + * @param int $limit + * @param int $productID + * @param int $branch + * @param object|null $pager + * @param bool $withChildren * @access public * @return array */ - public function getList($projectID = 0, $type = 'all', $status = 'all', $limit = 0, $productID = 0, $branch = 0, $pager = null, $withChildren = true) + public function getList(int $projectID = 0, string $type = 'all',string $status = 'all', int $limit = 0, int $productID = 0, int $branch = 0, object|null $pager = null, bool $withChildren = true) { if($status == 'involved') return $this->getInvolvedExecutionList($projectID, $status, $limit, $productID, $branch); @@ -1702,10 +1703,10 @@ class executionModel extends model return $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project= t2.id') ->where('t1.product')->eq($productID) + ->andWhere('t2.deleted')->eq(0) ->beginIF($projectID)->andWhere('t2.project')->eq($projectID)->fi() ->beginIF($type == 'all')->andWhere('t2.type')->in('sprint,stage,kanban')->fi() ->beginIF($type != 'all')->andWhere('t2.type')->eq($type)->fi() - ->andWhere('t2.deleted')->eq(0) ->beginIF($status == 'undone')->andWhere('t2.status')->notIN('done,closed')->fi() ->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi() ->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi() diff --git a/module/execution/test/execution.class.php b/module/execution/test/execution.class.php index cdcf341599..85cf951314 100644 --- a/module/execution/test/execution.class.php +++ b/module/execution/test/execution.class.php @@ -704,18 +704,19 @@ class executionTest } /** - * function getList test by execution + * 获取执行列表信息。 + * Get execution list information. * - * @param string $projectID + * @param int $projectID * @param string $type - * @param array $status - * @param string $limit - * @param string $productID - * @param string $count + * @param string $status + * @param int $limit + * @param int $productID + * @param int $count * @access public - * @return array + * @return array|int */ - public function getListTest($projectID, $type, $status, $limit, $productID, $count) + public function getListTest(int $projectID, string $type, string $status, int $limit, int $productID, int $count): array|int { $object = $this->executionModel->getList($projectID, $type, $status, $limit, $productID); diff --git a/module/execution/test/model/getlist.php b/module/execution/test/model/getlist.php index 045f95b5ed..c70f64462c 100755 --- a/module/execution/test/model/getlist.php +++ b/module/execution/test/model/getlist.php @@ -39,20 +39,8 @@ $projectProduct->gen(9); /** title=测试executionModel->getListTest(); +timeout=1 cid=1 -pid=1 - -敏捷项目执行列表查询 >> 2,迭代1 -瀑布项目执行列表查询 >> 3,阶段1,stage -看板项目执行列表查询 >> 4,看板1,kanban -产品1执行列表查询 >> 0 -敏捷执行列表查询 >> sprint,迭代2 -瀑布执行列表查询 >> stage,阶段2 -看板执行列表查询 >> kanban,看板2 -wait执行列表查询 >> 0 -doing执行列表查询 >> doing,迭代1 -执行列表2条查询 >> 0 -执行列表10条查询 >> 6 */