diff --git a/module/bug/model.php b/module/bug/model.php index 151c28f977..7dafee858b 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -862,7 +862,8 @@ class bugModel extends model { $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('deleted')->eq(0) - ->andWhere("(project = '" . (int)$projectID . "' " . (empty($build) ? '' : "AND CONCAT(',', openedBuild, ',') like '%,$build,%'") . ")") + ->beginIF(empty($build))->andWhere('project')->eq($projectID)->fi() + ->beginIF($build)->andWhere("CONCAT(',', openedBuild, ',') like '%,$build,%'")->fi() ->orderBy($orderBy)->page($pager)->fetchAll(); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug');