* Rename getStageListBy function to getStageList.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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');
|
||||
|
||||
Regular → Executable
+11
-5
@@ -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下的阶段条数
|
||||
Reference in New Issue
Block a user