* 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
+2 -2
View File
@@ -37,7 +37,7 @@ class deptModel extends model
$rootDept = $this->getByID($rootDeptID);
if(!$rootDept) $rootDept->path = '';
return $this->dao->select('*')->from(TABLE_DEPT)
->onCaseOf($rootDeptID > 0)->where('path')->like($rootDept->path . '%')->endCase()
->beginIF($rootDeptID > 0)->where('path')->like($rootDept->path . '%')->endIF()
->orderBy('grade desc, `order`')
->get();
}
@@ -221,7 +221,7 @@ class deptModel extends model
{
return $this->dao->select('*')->from(TABLE_USER)
->where('deleted')->eq(0)
->onCaseOf($deptID)->andWhere('dept')->in($deptID)->endCase()
->beginIF($deptID)->andWhere('dept')->in($deptID)->endIF()
->orderBy('id')
->fetchAll();
}