* Refactor bugModel-getUserBugPairs, and modify its unit test.

This commit is contained in:
liumengyi
2023-06-02 16:45:37 +08:00
parent 202ea93076
commit 59fd03260a
3 changed files with 34 additions and 17 deletions
+4 -3
View File
@@ -873,9 +873,10 @@ class bugModel extends model
}
/**
* 测试获取用户的bugs的 id => title 数组。
* Get bug pairs of a user.
*
* @param int $account
* @param string $account
* @param bool $appendProduct
* @param int $limit
* @param array $skipProductIdList
@@ -884,9 +885,9 @@ class bugModel extends model
* @access public
* @return array
*/
public function getUserBugPairs($account, $appendProduct = true, $limit = 0, $skipProductIdList = array(), $skipExecutionIdList = array(), $appendBugID = 0)
public function getUserBugPairs(string $account, bool $appendProduct = true, int $limit = 0, array $skipProductIdList = array(), array $skipExecutionIdList = array(), array|int $appendBugID = 0): array
{
$deletedProjectIdList = $this->dao->select('*')->from(TABLE_PROJECT)->where('deleted')->eq(1)->fetchPairs('id', 'id');
$deletedProjectIdList = $this->dao->select('id')->from(TABLE_PROJECT)->where('deleted')->eq(1)->fetchPairs();
$bugs = array();
$stmt = $this->dao->select('t1.id, t1.title, t2.name as product')