diff --git a/module/programplan/model.php b/module/programplan/model.php index e421a532bd..e045be22a0 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -42,7 +42,7 @@ class programplanModel extends model */ public function getStage(int $executionID = 0, int $productID = 0, string $browseType = 'all', string $orderBy = 'id_asc'): array { - $plans = $this->programplanTao->getStageListBy($executionID, $productID, $browseType, $orderBy); + $plans = $this->programplanTao->getStageList($executionID, $productID, $browseType, $orderBy); return $this->processPlans($plans); } @@ -416,7 +416,7 @@ class programplanModel extends model { /* When parent is equal to true, query the total workload of the subphase. */ $executionID = $parent ? $stage->id : $stage->project; - $plans = $this->programplanTao->getStageListBy((int)$executionID, (int)$stage->product, $browseType = 'parent'); + $plans = $this->programplanTao->getStageList((int)$executionID, (int)$stage->product, $browseType = 'parent'); $totalPercent = 0; $stageID = $stage->id; diff --git a/module/programplan/tao.php b/module/programplan/tao.php index 91bdf4fe24..fab8824b7b 100644 --- a/module/programplan/tao.php +++ b/module/programplan/tao.php @@ -488,7 +488,7 @@ class programplanTao extends programplanModel * @access protected * @return array */ - protected function getStageListBy(int $executionID, int $productID, string $browseType, $orderBy = 'id_asc') + protected function getStageList(int $executionID, int $productID, string $browseType, $orderBy = 'id_asc') { if(empty($executionID)) return array(); $projectModel = $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($executionID)->fetch('model'); diff --git a/module/programplan/test/tao/getstagelistby.php b/module/programplan/test/tao/getstagelist.php old mode 100644 new mode 100755 similarity index 63% rename from module/programplan/test/tao/getstagelistby.php rename to module/programplan/test/tao/getstagelist.php index ba2769a533..f7c91dbdba --- a/module/programplan/test/tao/getstagelistby.php +++ b/module/programplan/test/tao/getstagelist.php @@ -6,13 +6,19 @@ include dirname(__FILE__, 5). '/test/lib/init.php'; su('admin'); /** + title=测试 loadModel->getStageListBy() +timeout=0 cid=1 -pid=1 + +- 获取id为3下的阶段名称属性name @阶段a子1子1 + +- 获取的不存的id和项目产品id 的阶段信息 @0 + +- 获取id为1下的阶段条数 @2 */ - zdTable('project')->config('project')->gen(5); zdTable('projectproduct')->config('projectproduct')->gen(5); @@ -22,11 +28,11 @@ $tester->loadModel('programplan')->programplanTao; $browseType = 'parent'; $IDList = array(1, 2, 3, 4, 5, 100); -$result = $tester->programplan->getStageListBy($IDList[2], 2, $browseType); +$result = $tester->programplan->getStageList($IDList[2], 2, $browseType); r($result[4]) && p('name') && e('阶段a子1子1'); // 获取id为3下的阶段名称 -$result = $tester->programplan->getStageListBy($IDList[5], 100, $browseType); +$result = $tester->programplan->getStageList($IDList[5], 100, $browseType); r($result) && p() && e('0'); // 获取的不存的id和项目产品id 的阶段信息 -$result = $tester->programplan->getStageListBy($IDList[0], 2, $browseType); +$result = $tester->programplan->getStageList($IDList[0], 2, $browseType); r(count($result)) && p() && e('2'); // 获取id为1下的阶段条数 diff --git a/module/programplan/test/tao/yaml/getstagelistby/project.yaml b/module/programplan/test/tao/yaml/getstagelist/project.yaml similarity index 100% rename from module/programplan/test/tao/yaml/getstagelistby/project.yaml rename to module/programplan/test/tao/yaml/getstagelist/project.yaml diff --git a/module/programplan/test/tao/yaml/getstagelistby/projectproduct.yaml b/module/programplan/test/tao/yaml/getstagelist/projectproduct.yaml similarity index 100% rename from module/programplan/test/tao/yaml/getstagelistby/projectproduct.yaml rename to module/programplan/test/tao/yaml/getstagelist/projectproduct.yaml