* change onCaseOf/endCase into beginIF/endIF

This commit is contained in:
chencongzhi520
2010-06-22 05:56:24 +00:00
parent 0d8748f2ba
commit 3a8564cbcb
11 changed files with 280 additions and 280 deletions
+8 -8
View File
@@ -380,8 +380,8 @@ class storyModel extends model
->from(TABLE_STORY)->alias('t1')
->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id')
->where('t1.product')->in($productID)
->onCaseOf(!empty($moduleIds))->andWhere('module')->in($moduleIds)->endCase()
->onCaseOf($status != 'all')->andWhere('status')->in($status)->endCase()
->beginIF(!empty($moduleIds))->andWhere('module')->in($moduleIds)->endIF()
->beginIF($status != 'all')->andWhere('status')->in($status)->endIF()
->andWhere('t1.deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
}
@@ -392,9 +392,9 @@ class storyModel extends model
$stories = $this->dao->select('t1.id, t1.title, t1.module, t2.name AS product')
->from(TABLE_STORY)->alias('t1')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('1=1')
->onCaseOf($productID)->andWhere('t1.product')->in($productID)->endCase()
->onCaseOf($moduleIds)->andWhere('t1.module')->in($moduleIds)->endCase()
->onCaseOf($status != 'all')->andWhere('status')->in($status)->endCase()
->beginIF($productID)->andWhere('t1.product')->in($productID)->endIF()
->beginIF($moduleIds)->andWhere('t1.module')->in($moduleIds)->endIF()
->beginIF($status != 'all')->andWhere('status')->in($status)->endIF()
->andWhere('t1.deleted')->eq(0)
->orderBy($order)
->fetchAll();
@@ -447,7 +447,7 @@ class storyModel extends model
->on('t1.product = t3.id')
->where('t1.project')->eq((int)$projectID)
->andWhere('t2.deleted')->eq(0)
->onCaseOf($productID)->andWhere('t1.product')->eq((int)$productID)->endCase()
->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->endIF()
->fetchAll();
if(!$stories) return array();
return $this->formatStories($stories);
@@ -458,7 +458,7 @@ class storyModel extends model
{
return $this->dao->select('*')->from(TABLE_STORY)
->where('plan')->eq((int)$planID)
->onCaseOf($status != 'all')->andWhere('status')->in($status)->endCase()
->beginIF($status != 'all')->andWhere('status')->in($status)->endIF()
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll('id');
}
@@ -468,7 +468,7 @@ class storyModel extends model
{
return $this->dao->select('*')->from(TABLE_STORY)
->where('plan')->eq($planID)
->onCaseOf($status != 'all')->andWhere('status')->in($status)->endCase()
->beginIF($status != 'all')->andWhere('status')->in($status)->endIF()
->andWhere('deleted')->eq(0)
->fetchAll();
}