* Rename getStageListBy function to getStageList.

This commit is contained in:
jukui
2023-05-11 20:27:36 +08:00
parent 07fe61cd52
commit 66dce85591
5 changed files with 14 additions and 8 deletions
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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');
@@ -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下的阶段条数