From 81e306ea2ffa014ec757c6355c69f8aec39e8635 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Fri, 19 Mar 2010 03:15:14 +0000 Subject: [PATCH] * adjust the code of getModuleBugs() method. --- module/bug/model.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 6f657ebbca..adbbc1e669 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -64,9 +64,10 @@ class bugModel extends model /* 获得某一个产品,某一个模块下面的所有bug。*/ public function getModuleBugs($productID, $moduleIds = 0, $orderBy = 'iddesc', $pager = null) { - $sql = $this->dao->select('*')->from(TABLE_BUG)->where('product')->eq((int)$productID); - if(!empty($moduleIds)) $sql->andWhere('module')->in($moduleIds); - return $sql->orderBy($orderBy)->page($pager)->fetchAll(); + return $this->dao->select('*')->from(TABLE_BUG) + ->where('product')->eq((int)$productID) + ->onCaseOf(!empty($moduleIds))->andWhere('module')->in($moduleIds)->endCase() + ->orderBy($orderBy)->page($pager)->fetchAll(); } /* 获取一个bug的详细信息。*/