* Finish task#8781.

This commit is contained in:
leiyong
2020-12-24 22:16:49 +08:00
parent bc5db7f6ed
commit db18b9b3e9
4 changed files with 40 additions and 4 deletions
+30
View File
@@ -1079,6 +1079,36 @@ class testtaskModel extends model
return $runs;
}
/**
* Get testtask pairs of a user.
*
* @param string $account
* @param int $limit
* @param string $status all|wait|doing|done|blocked
* @param string $skipProjectIDList
* @access public
* @return array
*/
public function getUserTesttaskPairs($account, $limit = 10, $status = 'all', $skipProjectIDList = '')
{
$stmt = $this->dao->select('t1.id, t1.name, t2.name as project')
->from(TABLE_TESTTASK)->alias('t1')
->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.PRJ = t2.id')
->where('t1.owner')->eq($account)
->andWhere('t1.deleted')->eq(0)
->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi()
->beginIF(!empty($skipProjectIDList))->andWhere('t1.project')->notin($skipProjectIDList)->fi()
->limit($limit)
->query();
$testtaskPairs = array();
while($testtask = $stmt->fetch())
{
$testtaskPairs[$testtask->id] = $testtask->project . ' / ' . $testtask->name;
}
return $testtaskPairs;
}
/**
* Get info of a test run.
*