* Fix project and product relation bug.
This commit is contained in:
@@ -1614,8 +1614,11 @@ class projectModel extends model
|
||||
}
|
||||
|
||||
/* Delete the execution linked products that is not linked with the execution. */
|
||||
$executions = $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq((int)$projectID)->fetchPairs('id');
|
||||
$this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->in($executions)->andWhere('product')->notin($products)->exec();
|
||||
if($projectID)
|
||||
{
|
||||
$executions = $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq((int)$projectID)->fetchPairs('id');
|
||||
$this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->in($executions)->andWhere('product')->notin($products)->exec();
|
||||
}
|
||||
|
||||
$oldProductKeys = array_keys($oldProjectProducts);
|
||||
$needUpdate = array_merge(array_diff($oldProductKeys, $products), array_diff($products, $oldProductKeys));
|
||||
|
||||
Reference in New Issue
Block a user