This commit is contained in:
liumengyi
2023-03-07 06:52:09 +00:00
parent f42686f080
commit b25022e3b0
2 changed files with 9 additions and 2 deletions
+2 -2
View File
@@ -2190,7 +2190,7 @@ class project extends control
}
$oldProducts = $this->product->getProducts($projectID);
if($project->multiple and $project->model != 'waterfall') $oldExecutionProducts = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchGroup('project', 'product');
if($project->multiple and $project->model != 'waterfall' and $project->model != 'waterfallplus') $oldExecutionProducts = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchGroup('project', 'product');
$this->project->updateProducts($projectID);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
@@ -2216,7 +2216,7 @@ class project extends control
}
}
if($project->multiple and $project->model != 'waterfall')
if($project->multiple and $project->model != 'waterfall' and $project->model != 'waterfallplus')
{
$unlinkedProducts = array_diff($oldProductIDs, $newProductIDs);
if(!empty($unlinkedProducts))
+7
View File
@@ -2502,6 +2502,13 @@ class projectModel extends model
$this->dao->update(TABLE_PROJECT)->set('division')->eq('1')->where('id')->eq((int)$projectID)->exec();
$this->dao->update(TABLE_EXECUTION)->set('division')->eq('1')->where('project')->eq((int)$projectID)->exec();
}
$project = $this->getByID($projectID);
if(!empty($project) and ($project->model == 'waterfall' or $project->model == 'waterfallplus') and empty($project->division) and !empty($executions))
{
$this->loadModel('execution');
foreach($executions as $executionID) $this->execution->updateProducts($executionID);
}
}
$oldProductKeys = array_keys($oldProjectProducts);