* fix the bug of convertModule.

This commit is contained in:
wangchunsheng
2010-03-29 07:52:59 +00:00
parent b46979f6b1
commit d984aeabb6
2 changed files with 8 additions and 5 deletions

View File

@@ -148,9 +148,11 @@ class bugfree1ConvertModel extends bugfreeConvertModel
}
/* <20><><EFBFBD><EFBFBD>parent<6E><74>*/
foreach($this->map['module'] as $oldModuleID => $newModuleID)
foreach($modules as $oldModuleID => $module)
{
$this->dao->dbh($this->dbh)->update(TABLE_MODULE)->set('parent')->eq($newModuleID)->where('parent')->eq($oldModuleID)->exec();
$newModuleID = $this->map['module'][$oldModuleID];
$newParentID = $this->map['module'][$module->parent];
$this->dao->dbh($this->dbh)->update(TABLE_MODULE)->set('parent')->eq($newParentID)->where('id')->eq($newModuleID)->exec();
}
return count($modules);
}

View File

@@ -26,7 +26,6 @@ class bugfree2ConvertModel extends bugfreeConvertModel
/* ִ<><D6B4>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>*/
public function execute()
{
$this->clear();
$this->setTable();
$this->convertGroup();
$result['users'] = $this->convertUser();
@@ -169,9 +168,11 @@ class bugfree2ConvertModel extends bugfreeConvertModel
}
/* <20><><EFBFBD><EFBFBD>parent<6E><74>*/
foreach($this->map['module'] as $oldModuleID => $newModuleID)
foreach($modules as $oldModuleID => $module)
{
$this->dao->dbh($this->dbh)->update(TABLE_MODULE)->set('parent')->eq($newModuleID)->where('parent')->eq($oldModuleID)->exec();
$newModuleID = $this->map['module'][$oldModuleID];
$newParentID = $this->map['module'][$module->parent];
$this->dao->dbh($this->dbh)->update(TABLE_MODULE)->set('parent')->eq($newParentID)->where('id')->eq($newModuleID)->exec();
}
return count($modules);
}