diff --git a/module/product/model.php b/module/product/model.php index d3ca62c9b6..a93d1f0555 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1328,7 +1328,7 @@ class productModel extends model $executions = $this->dao->select('t2.id,t2.name,t2.grade,t2.parent,t2.attribute')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.product')->eq($productID) - ->andWhere('t2.project')->eq($projectID) + ->beginIF($projectID)->andWhere('t2.project')->eq($projectID)->fi() ->beginIF($branch !== '')->andWhere('t1.branch')->in($branch)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi() ->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('t2.status')->ne('closed')->fi()