From 38ed825461963eae91905a55837e0e6ea48c46bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Tue, 1 Mar 2022 13:58:00 +0800 Subject: [PATCH] * adjust for get testtask list. --- module/testtask/control.php | 2 ++ module/testtask/model.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 5b140c4b6d..52df0442b3 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -109,6 +109,8 @@ class testtask extends control $sort = common::appendOrder($orderBy); /* Get tasks. */ + $product = $this->product->getById($productID); + if($product->type == 'normal') $branch = 'all'; $tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $scopeAndStatus, $beginTime, $endTime); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->common; diff --git a/module/testtask/model.php b/module/testtask/model.php index 322814e16c..3845a79242 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -68,9 +68,10 @@ class testtaskModel extends model * @access public * @return array */ - public function getProductTasks($productID, $branch = 0, $orderBy = 'id_desc', $pager = null, $scopeAndStatus = array(), $beginTime = 0, $endTime = 0) + public function getProductTasks($productID, $branch = 'all', $orderBy = 'id_desc', $pager = null, $scopeAndStatus = array(), $beginTime = 0, $endTime = 0) { $products = $scopeAndStatus[0] == 'all' ? $this->app->user->view->products : array(); + $branch = $scopeAndStatus[0] == 'all' ? 'all' : $branch; return $this->dao->select("t1.*, t2.name AS productName, t3.name AS executionName, t4.name AS buildName, t4.branch AS branch") ->from(TABLE_TESTTASK)->alias('t1')