* adjust code for upgrade.

This commit is contained in:
shiyangyangwork@yahoo.cn
2012-02-17 09:06:57 +00:00
parent bcc82e154d
commit 705af69e99
+10 -3
View File
@@ -1064,7 +1064,7 @@ class upgradeModel extends model
foreach($projectActions as $key => $projectID)
{
$products = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchPairs('product');
$productList = ',' . join(',', array_keys($products)) . ',';
$productList = join(',', array_keys($products));
$this->dao->update(TABLE_ACTION)->set('product')->eq($productList)->where('objectType')->eq('project')->andWhere('objectID')->eq($projectID)->exec();
}
@@ -1074,15 +1074,22 @@ class upgradeModel extends model
if($task[$taskID] != 0)
{
$product = $this->dao->select('product')->from(TABLE_STORY)->where('id')->eq($task[$taskID])->fetchPairs('product');
$productList = ',' . join(',', array_keys($product)) . ',';
$productList = join(',', array_keys($product));
}
else
{
$products = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchPairs('product');
$productList = ',' . join(',', array_keys($products)) . ',';
$productList = join(',', array_keys($products));
}
$this->dao->update(TABLE_ACTION)->set('product')->eq($productList)->where('objectType')->eq('task')->andWhere('objectID')->eq($taskID)->andWhere('project')->eq($projectID)->exec();
}
$actions = $this->dao->select('id,product')->from(TABLE_ACTION)->fetchPairs('id');
foreach($actions as $id => $product)
{
$product = ',' . $product . ',';
$this->dao->update(TABLE_ACTION)->set('product')->eq($product)->exec();
}
}
/**