From f455ff5a89c1e7a81c5b3d020996c655aa1de45a Mon Sep 17 00:00:00 2001 From: daitingting Date: Fri, 6 Jan 2023 07:22:45 +0000 Subject: [PATCH] * Finish task #82058. --- module/bug/model.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index c4ebe96f61..b1bc91512f 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1528,16 +1528,24 @@ class bugModel extends model */ public function getBugs2Link($bugID, $browseType = 'bySearch', $queryID = 0, $pager = null, $excludeBugs = '') { + $bug = $this->getById($bugID); + $bugIDList = $bug->id . ',' . $bug->linkBug . ',' . $excludeBugs; + if($browseType == 'bySearch') { - $bug = $this->getById($bugID); - $bugIDList = $bug->id . ',' . $bug->linkBug . ',' . $excludeBugs; - $bugs2Link = $this->getBySearch($bug->product, 'all', $queryID, 'id', $bugIDList, $pager); - return $bugs2Link; + return $this->getBySearch($bug->product, 'all', $queryID, 'id', $bugIDList, $pager); } else { - return array(); + return $this->dao->select('*')->from(TABLE_BUG) + ->where('deleted')->eq('0') + ->andWhere('id')->notin($bugIDList) + ->andWhere('product')->eq($bug->product) + ->beginIF($bug->project)->andWhere('project')->eq($bug->project)->fi() + ->beginIF($bug->execution)->andWhere('execution')->eq($bug->execution)->fi() + ->orderBy('id desc') + ->page($pager) + ->fetchAll(); } }