* finish task #53651.

This commit is contained in:
zhouxudong
2022-05-12 00:30:00 +00:00
parent c0886b850d
commit 65fff67e58
4 changed files with 43 additions and 12 deletions
+21
View File
@@ -565,6 +565,27 @@ class executionModel extends model
/* Fix bug#3074, Update views for team members. */
if($execution->acl != 'open') $this->updateUserView($executionID, 'sprint', $changedAccounts);
if(isset($execution->project))
{
$executionProductList = $this->loadModel('product')->getProducts($executionID);
$projectProductList = $this->product->getProducts($execution->project);
$executionProductIdList = array_keys($executionProductList);
$projectProductIdList = array_keys($projectProductList);
$diffProductIdList = array_diff($executionProductIdList, $projectProductIdList);
if(!empty($diffProductIdList))
{
foreach($diffProductIdList as $key => $newProductID)
{
$data = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)
->where('project')->eq($executionID)
->andWhere('product')->eq($newProductID)
->fetch();
$data->project = $execution->project;
$this->dao->insert(TABLE_PROJECTPRODUCT)->data($data)->exec();
}
}
}
if(!dao::isError())
{
if(isset($execution->project) and $execution->project != $oldExecution->project)