* kanban: refactor getLanePairsByGroup.
This commit is contained in:
@@ -1052,6 +1052,7 @@ class kanbanModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分组ID获取泳道键值对。
|
||||
* Get kanban lane pairs by group id.
|
||||
*
|
||||
* @param int $groupID
|
||||
@@ -1059,7 +1060,7 @@ class kanbanModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getLanePairsByGroup($groupID, $orderBy = '`order`_asc')
|
||||
public function getLanePairsByGroup(int $groupID, string $orderBy = '`order`_asc'): array
|
||||
{
|
||||
return $this->dao->select('id,name')->from(TABLE_KANBANLANE)
|
||||
->where('deleted')->eq(0)
|
||||
|
||||
@@ -4,28 +4,30 @@ include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/kanban.class.php';
|
||||
su('admin');
|
||||
|
||||
zdTable('kanbanlane')->gen(10);
|
||||
|
||||
/**
|
||||
|
||||
title=测试 kanbanModel->getLanePairsByGroup();
|
||||
timeout=0
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取泳道组101的泳道 >> 研发需求
|
||||
获取泳道组102的泳道 >> Bug
|
||||
获取泳道组103的泳道 >> 任务
|
||||
获取泳道组104的泳道 >> 研发需求
|
||||
获取泳道组105的泳道 >> Bug
|
||||
获取不存在泳道组的泳道 >> 0
|
||||
- 获取泳道组1的泳道 @默认泳道
|
||||
- 获取泳道组2的泳道 @默认泳道
|
||||
- 获取泳道组3的泳道 @默认泳道
|
||||
- 获取泳道组4的泳道 @默认泳道
|
||||
- 获取泳道组5的泳道 @默认泳道
|
||||
- 获取不存在泳道组的泳道 @0
|
||||
|
||||
*/
|
||||
|
||||
$groupIDList = array('101', '102', '103', '104', '105', '1000001');
|
||||
$groupIDList = array('1', '2', '3', '4', '5', '1000001');
|
||||
|
||||
$kanban = new kanbanTest();
|
||||
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[0])) && p() && e('研发需求'); // 获取泳道组101的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[1])) && p() && e('Bug'); // 获取泳道组102的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[2])) && p() && e('任务'); // 获取泳道组103的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[3])) && p() && e('研发需求'); // 获取泳道组104的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[4])) && p() && e('Bug'); // 获取泳道组105的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[5])) && p() && e('0'); // 获取不存在泳道组的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[0])) && p() && e('默认泳道'); // 获取泳道组1的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[1])) && p() && e('默认泳道'); // 获取泳道组2的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[2])) && p() && e('默认泳道'); // 获取泳道组3的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[3])) && p() && e('默认泳道'); // 获取泳道组4的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[4])) && p() && e('默认泳道'); // 获取泳道组5的泳道
|
||||
r($kanban->getLanePairsByGroupTest($groupIDList[5])) && p() && e('0'); // 获取不存在泳道组的泳道
|
||||
Reference in New Issue
Block a user