* fix the bug of convertModule.

This commit is contained in:
wangchunsheng
2010-03-29 07:52:59 +00:00
parent db16ec554e
commit 4e825b6be8
2 changed files with 8 additions and 5 deletions
+4 -2
View File
@@ -148,9 +148,11 @@ class bugfree1ConvertModel extends bugfreeConvertModel
}
/* 更新parent。*/
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);
}
+4 -3
View File
@@ -26,7 +26,6 @@ class bugfree2ConvertModel extends bugfreeConvertModel
/* 执行转换。*/
public function execute()
{
$this->clear();
$this->setTable();
$this->convertGroup();
$result['users'] = $this->convertUser();
@@ -169,9 +168,11 @@ class bugfree2ConvertModel extends bugfreeConvertModel
}
/* 更新parent。*/
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);
}