From b9190b8d9250d79d446b85e7521d96b5683f4cee Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 30 Aug 2022 15:14:36 +0800 Subject: [PATCH] * Solve bug link bug search all products reported errors. --- module/bug/model.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/module/bug/model.php b/module/bug/model.php index 66472d082b..9730388210 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2935,7 +2935,21 @@ class bugModel extends model /* If search criteria don't have products, append the selected product from the top left dropdown-menu. */ if(is_array($productIDList)) $productIDList = implode(',', $productIDList); - if(strpos($bugQuery, '`product`') === false) $bugQuery .= ' AND `product` IN (' . $productIDList . ')'; + if(strpos($bugQuery, '`product`') === false) + { + $bugQuery .= ' AND `product` IN (' . $productIDList . ')'; + } + else + { + $productParis = $this->loadModel('product')->getPairs(); + $productIDList = array_keys($productParis); + + if(!empty($productIDList)) + { + $productIDList = implode(',', $productIDList); + $bugQuery .= ' AND `product` IN (' . $productIDList . ')'; + } + } $allBranch = "`branch` = 'all'"; if($branch !== 'all' and strpos($bugQuery, '`branch` =') === false) $bugQuery .= " AND `branch` in('0','$branch')";