From f5caade0e4e115f9377100ba95cf1e2fb9598a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 11 Aug 2021 13:57:55 +0800 Subject: [PATCH] * fix bug for fulltext search and action. --- module/action/model.php | 2 +- module/projectrelease/model.php | 4 +--- module/search/model.php | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index bc601a6d23..0738ab9bbf 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -965,7 +965,7 @@ class actionModel extends model $objectName = array(); $objectProject = array(); - if(strpos($this->config->action->needGetProjectType, $objectType) !== false) + if(strpos(",{$this->config->action->needGetProjectType},", ",{$objectType},") !== false) { $objectInfo = $this->dao->select("id, project, $field AS name")->from($table)->where('id')->in($objectIds)->fetchAll(); foreach($objectInfo as $object) diff --git a/module/projectrelease/model.php b/module/projectrelease/model.php index d8a7c3d3df..e252327854 100644 --- a/module/projectrelease/model.php +++ b/module/projectrelease/model.php @@ -44,13 +44,11 @@ class projectreleaseModel extends model * Get list of releases. * * @param int $projectID - * @param int $productID - * @param int $branch * @param string $type * @access public * @return array */ - public function getList($projectID, $productID, $branch = 0, $type = 'all') + public function getList($projectID, $type = 'all') { return $this->dao->select('t1.*, t2.name as productName, t3.id as buildID, t3.name as buildName, t3.execution, t4.name as executionName') ->from(TABLE_RELEASE)->alias('t1') diff --git a/module/search/model.php b/module/search/model.php index 969ada5184..329e45ae1d 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -701,7 +701,7 @@ class searchModel extends model if(empty($savedDict)) $savedDict = $this->dao->select("`key`")->from(TABLE_SEARCHDICT)->fetchPairs('key', 'key'); foreach($dict as $key => $value) { - if(!is_numeric($key) or empty($value) or strlen($key) != 5) continue; + if(!is_numeric($key) or empty($value) or strlen($key) != 5 or $key < 0) continue; if(isset($savedDict[$key])) continue; $this->dao->insert(TABLE_SEARCHDICT)->data(array('key' => $key, 'value' => $value))->exec();