From e5e8ecaa685ce3a5e232bd8937a1860cc58d3a72 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 19 Dec 2022 16:05:17 +0800 Subject: [PATCH] * Code for task#80490. --- module/search/model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/search/model.php b/module/search/model.php index fda31e9aac..d408aec316 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -978,6 +978,7 @@ class searchModel extends model $programs = $this->app->user->view->programs; $projects = $this->app->user->view->projects; $executions = $this->app->user->view->sprints; + $ticketProducts = $this->loadModel('feedback')->getGrantProducts(); $objectPairs = array(); $total = count($results); @@ -992,7 +993,7 @@ class searchModel extends model $objectExecutions = array(); if(!isset($this->config->objectTables[$objectType])) continue; $table = $this->config->objectTables[$objectType]; - if(strpos(',bug,case,testcase,productplan,release,story,testtask,', ",$objectType,") !== false) + if(strpos(',bug,case,testcase,productplan,release,story,testtask,ticket,', ",$objectType,") !== false) { $objectProducts = $this->dao->select('id,product')->from($table)->where('id')->in(array_keys($objectIdList))->fetchGroup('product', 'id'); } @@ -1103,7 +1104,7 @@ class searchModel extends model foreach($objectProducts as $productID => $idList) { if(empty($productID)) continue; - if(strpos(",$products,", ",$productID,") === false) + if(strpos(",$products,", ",$productID,") === false or ($objectType == 'ticket' and !isset($ticketProducts[$productID]))) { foreach($idList as $object) {