* adjust the code of getModuleBugs() method.

This commit is contained in:
wangchunsheng
2010-03-19 03:15:14 +00:00
parent 92568b9393
commit 81e306ea2f

View File

@@ -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的详细信息。*/