* use dao to write the sql.

This commit is contained in:
wangchunsheng
2010-04-08 08:52:39 +00:00
parent 9b5f34fa33
commit 454a74835f
+1 -2
View File
@@ -99,8 +99,7 @@ class groupModel extends model
public function getPrivs($groupID)
{
$privs = array();
$sql = "SELECT module, method FROM " . TABLE_GROUPPRIV . " WHERE `group` = '$groupID' ORDER BY module";
$stmt = $this->dbh->query($sql);
$stmt = $this->dao->select('module, method')->from(TABLE_GROUPPRIV)->where('`group`')->eq($groupID)->orderBy('module')->query();
while($priv = $stmt->fetch()) $privs[$priv->module][$priv->method] = $priv->method;
return $privs;
}