From 565cc52316d2bd5c08914bffcedb10883f07d59b Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Mon, 9 Dec 2024 08:53:57 +0000 Subject: [PATCH] * [story#69800,0.5h] add buildSearchConfig. --- module/testcase/model.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/module/testcase/model.php b/module/testcase/model.php index 6547dc9024..190aace942 100755 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -2810,6 +2810,22 @@ class testcaseModel extends model unset($this->config->testcase->search['fields']['product']); unset($this->config->testcase->search['params']['product']); + $product = $this->loadModel('product')->getByID($productID ? $productID : 0); + if($productID) + { + if(isset($product->type) && $product->type == 'normal') + { + unset($this->config->testcase->search['fields']['branch']); + unset($this->config->testcase->search['params']['branch']); + } + else + { + $branches = $this->loadModel('branch')->getPairs($productID, '', 0); + $this->config->testcase->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); + $this->config->testcase->search['params']['branch']['values'] = array('' => '', BRANCH_MAIN => $this->lang->branch->main) + $branches + array('all' => $this->lang->branch->all); + } + } + if(!$this->config->testcase->needReview) unset($this->config->testcase->search['params']['status']['values']['wait']); $searchConfig = $this->loadModel('search')->processBuildinFields('testcase', $this->config->testcase->search);