From 5dacb4172989e708b4ae664d66fbe755be756a2f Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Fri, 4 Dec 2020 11:28:46 +0800 Subject: [PATCH] * Fix bug. --- module/product/model.php | 1 + module/project/model.php | 9 +-------- module/projectbuild/control.php | 14 +++++++++----- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index e1d541ffef..187ee5dfde 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -818,6 +818,7 @@ class productModel extends model ->andWhere('t2.deleted')->eq('0') ->orderBy($orderBy) ->fetchAll('id'); + $executionList = array('0' => ''); $project = $this->loadModel('program')->getPRJByID($this->session->PRJ); diff --git a/module/project/model.php b/module/project/model.php index 8dca37f636..1a789467dd 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2941,12 +2941,10 @@ class projectModel extends model * @param array $products * @param int $queryID * @param string $actionURL - * @param array $projects - * @param string $type projectBuild * @access public * @return void */ - public function buildProjectBuildSearchForm($products, $queryID, $actionURL, $projects = '', $type = '') + public function buildProjectBuildSearchForm($products, $queryID, $actionURL) { $this->loadModel('build'); @@ -2955,11 +2953,6 @@ class projectModel extends model $this->config->build->search['actionURL'] = $actionURL; $this->config->build->search['queryID'] = $queryID; $this->config->build->search['params']['product']['values'] = $products; - if($type == 'projectBuild') - { - $this->config->build->search['fields']['project'] = $this->lang->projectCommon; - $this->config->build->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $projects); - } $this->loadModel('search')->setSearchParams($this->config->build->search); } diff --git a/module/projectbuild/control.php b/module/projectbuild/control.php index 33fc048a43..47d8320802 100644 --- a/module/projectbuild/control.php +++ b/module/projectbuild/control.php @@ -22,27 +22,31 @@ class projectBuild extends control public function browse($projectID = 0, $type = 'all', $param = 0) { $this->loadModel('project'); + $this->loadModel('build'); $project = $this->loadModel('program')->getPRJByID($projectID); /* Get products' list. */ $products = $this->project->getProducts($projectID, false); $products = array('' => '') + $products; - $projects = $this->project->getExecutionsByProject((int)$projectID, 'all', '', true); - /* Build the search form. */ $type = strtolower($type); - $queryID = ($type == 'bysearch') ? (int)$param : 0; + $queryID = ($type == 'bysearch') ? (int)$param : 0; $actionURL = $this->createLink('projectbuild', 'browse', "projectID=$projectID&type=bysearch&queryID=myQueryID"); + + $projects = $this->project->getExecutionsByProject($projectID, 'all', '', true); + $this->config->build->search['fields']['project'] = $this->project->lang->projectCommon; + $this->config->build->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $projects); + $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL, $projects, 'projectBuild'); if($type == 'bysearch') { - $builds = $this->loadModel('build')->getProjectBuildsBySearch((int)$projectID, (int)$param); + $builds = $this->build->getProjectBuildsBySearch((int)$projectID, (int)$param); } else { - $builds = $this->loadModel('build')->getProjectBuilds((int)$projectID, $type, $param); + $builds = $this->build->getProjectBuilds((int)$projectID, $type, $param); } /* Set project builds. */