diff --git a/module/bug/model.php b/module/bug/model.php index 457e9ef61a..d92d3389c1 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1031,6 +1031,7 @@ class bugModel extends model if(strpos($orderBy, 'pri_') !== false) $orderBy = str_replace('pri_', 'priOrder_', $orderBy); if(strpos($orderBy, 'severity_') !== false) $orderBy = str_replace('severity_', 'severityOrder_', $orderBy); + if(strpos($orderBy, 'status') !== false) $orderBy = str_replace('status', 'statusOrder', $orderBy); $type = strtolower($type); if($type == 'bysearch') @@ -1051,7 +1052,7 @@ class bugModel extends model $condition = "($condition)"; } - $bugs = $this->dao->select("t1.*, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) AS priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) AS severityOrder")->from(TABLE_BUG)->alias('t1') + $bugs = $this->dao->select("t1.*, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) AS priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) AS severityOrder, INSTR('active,resolved,closed,', t1.status) as statusOrder")->from(TABLE_BUG)->alias('t1') ->leftJoin(TABLE_MODULE)->alias('t2')->on('t1.module = t2.id') ->where('t1.deleted')->eq('0') ->beginIF(!empty($productID) && $branchID !== 'all')->andWhere('t1.branch')->eq($branchID)->fi() diff --git a/module/task/tao.php b/module/task/tao.php index d95daacdf7..e5d4e85960 100644 --- a/module/task/tao.php +++ b/module/task/tao.php @@ -511,7 +511,8 @@ class taskTao extends taskModel { if(is_string($type)) $type = strtolower($type); $orderBy = str_replace('pri_', 'priOrder_', $orderBy); - $fields = "DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder"; + $orderBy = str_replace('status', 'statusOrder', $orderBy); + $fields = "DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, INSTR('wait,doing,done,pause,cancel,closed,', t1.status) as statusOrder"; ($this->config->edition == 'max' or $this->config->edition == 'ipd') && $fields .= ', t5.name as designName, t5.version as latestDesignVersion'; $actionIDList = array(); diff --git a/module/task/test/lib/task.unittest.class.php b/module/task/test/lib/task.unittest.class.php index 76b15fb886..f3dc77d2d8 100755 --- a/module/task/test/lib/task.unittest.class.php +++ b/module/task/test/lib/task.unittest.class.php @@ -686,7 +686,7 @@ class taskTest * @access public * @return array */ - public function updateTeamByEffortTest(int $effortID, object $record, int $taskID, ?object $task = null, string $lastDate): array + public function updateTeamByEffortTest(int $effortID, object $record, int $taskID, mix $task = null, string $lastDate): array { $task = $this->objectModel->getByID($taskID); $currentTeam = $this->objectModel->getTeamByAccount($task->team); diff --git a/module/task/test/tao/fetchexecutiontasks.php b/module/task/test/tao/fetchexecutiontasks.php index 55dc00bb1a..63caf1bc79 100755 --- a/module/task/test/tao/fetchexecutiontasks.php +++ b/module/task/test/tao/fetchexecutiontasks.php @@ -234,4 +234,4 @@ r($task->fetchExecutionTasksTest($executionIdList[2], $productIdList[0], $type[0 r($task->fetchExecutionTasksTest($executionIdList[2], $productIdList[0], $type[0], $modules[3], $orderBy[0], $count[0])) && p('2:name') && e('任务2'); // 测试获取执行ID 2 product 0 type all module array(2,8) orederBy 'status_asc, id_desc' 的任务 r($task->fetchExecutionTasksTest($executionIdList[2], $productIdList[0], $type[0], $modules[3], $orderBy[0], $count[1])) && p() && e('2'); // 测试获取执行ID 2 product 0 type all module array(2,8) orederBy 'status_asc, id_desc' 的任务数量 r($task->fetchExecutionTasksTest($executionIdList[2], $productIdList[0], $type[0], $modules[0], $orderBy[1], $count[0])) && p('20:name') && e('任务20'); // 测试获取执行ID 2 product 0 type all module 空 orederBy 'pri_desc' 的任务 -r($task->fetchExecutionTasksTest($executionIdList[2], $productIdList[0], $type[0], $modules[0], $orderBy[1], $count[1])) && p() && e('10'); // 测试获取执行ID 2 product 0 type all module 空 orederBy 'pri_desc' 的任务数量 +r($task->fetchExecutionTasksTest($executionIdList[2], $productIdList[0], $type[0], $modules[0], $orderBy[1], $count[1])) && p() && e('10'); // 测试获取执行ID 2 product 0 type all module 空 orederBy 'pri_desc' 的任务数量 \ No newline at end of file