* adjust var name.

This commit is contained in:
wyd621
2013-11-20 01:56:43 +00:00
parent 6078a7bc59
commit c3d42dbe2e
+5 -5
View File
@@ -732,20 +732,20 @@ class upgradeModel extends model
$this->dbh->exec("ALTER TABLE " . TABLE_GROUPPRIV . " DROP `company`;");
/* Delete version and sn that don's conform to the rules. Prevent conflict when delete company's field.*/
$configs = $this->dao->select('*')->from(TABLE_CONFIG)->orderBy('id desc')->fetchAll('id');
$rows = $this->dao->select('*')->from(TABLE_CONFIG)->orderBy('id desc')->fetchAll('id');
$items = array();
$delID = array();
foreach($configs as $config)
$delList = array();
foreach($rows as $config)
{
if(isset($items[$config->owner][$config->module][$config->section][$config->key]))
{
$delID[] = $config->id;
$delList[] = $config->id;
continue;
}
$items[$config->owner][$config->module][$config->section][$config->key] = $config->id;
}
if($delID) $this->dao->delete()->from(TABLE_CONFIG)->where('id')->in($delID)->exec();
if($delList) $this->dao->delete()->from(TABLE_CONFIG)->where('id')->in($delList)->exec();
$this->dbh->exec("ALTER TABLE " . TABLE_CONFIG . " DROP `company`;");