This commit is contained in:
hufangzhou
2021-11-11 11:07:23 +08:00
parent 802ff05157
commit 8e9f8b860e
5 changed files with 176 additions and 169 deletions
+8 -7
View File
@@ -82,12 +82,13 @@ class testtask extends control
/**
* Browse test tasks.
*
* @param int $productID
* @param string $type
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @param int $productID
* @param int|string $branch
* @param string $type
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
@@ -108,7 +109,7 @@ class testtask extends control
/* Set menu. */
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = (int)$this->cookie->preBranch;
$branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch;
$this->loadModel('qa')->setMenu($this->products, $productID, $branch, $type);
/* Load pager. */
+8 -8
View File
@@ -58,13 +58,13 @@ class testtaskModel extends model
/**
* Get test tasks of a product.
*
* @param int $productID
* @param int $branch
* @param string $orderBy
* @param object $pager
* @param array $scopeAndStatus
* @param int $beginTime
* @param int $endTime
* @param int $productID
* @param int|string $branch
* @param string $orderBy
* @param object $pager
* @param array $scopeAndStatus
* @param int $beginTime
* @param int $endTime
* @access public
* @return array
*/
@@ -86,7 +86,7 @@ class testtaskModel extends model
->beginIF($scopeAndStatus[0] == 'all')->andWhere('t1.product')->in($products)->fi()
->beginIF($scopeAndStatus[1] == 'totalStatus')->andWhere('t1.status')->in('blocked,doing,wait,done')->fi()
->beginIF($scopeAndStatus[1] != 'totalStatus')->andWhere('t1.status')->eq($scopeAndStatus[1])->fi()
->beginIF($branch)->andWhere("if(t4.branch, t4.branch, t5.branch) = '$branch'")->fi()
->beginIF($branch !== 'all')->andWhere("if(t4.branch, t4.branch, t5.branch) = '$branch'")->fi()
->beginIF($beginTime)->andWhere('t1.begin')->ge($beginTime)->fi()
->beginIF($endTime)->andWhere('t1.end')->le($endTime)->fi()
->orderBy($orderBy)