* [misc] modify upgrade.

This commit is contained in:
sunguangming
2025-11-12 03:29:08 +00:00
parent 5cce95fb9c
commit 9afff82f64
+7 -2
View File
@@ -1066,9 +1066,12 @@ class upgradeTao extends upgradeModel
*/
protected function copyActivity(object $activity, int $processID, int $groupID, array $outputGroup)
{
$outputList = zget($outputGroup, $activity->id, array());
$outputList = zget($outputGroup, $activity->id, array());
$projectIdList = $this->dao->select('id')->from(TABLE_PROJECT)->where('workflowGroup')->eq($groupID)->fetchPairs();
$oldActivityID = $activity->id;
unset($activity->id);
$activity->process = $processID;
$activity->optional = !empty($activity->optional) ? $activity->optional : 'no';
$activity->workflowGroup = $groupID;
@@ -1079,6 +1082,9 @@ class upgradeTao extends upgradeModel
$newActivityID = $this->dao->lastInsertID();
$this->dao->update(TABLE_AUDITPLAN)->set('objectID')->eq($newActivityID)->where('objectID')->eq($oldActivityID)->andWhere('objectType')->eq('activity')->andWhere('project')->in($projectIdList)->exec();
$this->dao->update(TABLE_PROGRAMACTIVITY)->set('activity')->eq($newActivityID)->where('activity')->eq($oldActivityID)->andWhere('project')->in($projectIdList)->exec();
$idMap = array();
foreach($outputList as $output)
{
@@ -1093,7 +1099,6 @@ class upgradeTao extends upgradeModel
$idMap[$oldID] = $newOutputID;
}
$projectIdList = $this->dao->select('id')->from(TABLE_PROJECT)->where('workflowGroup')->eq($groupID)->fetchPairs();
foreach($idMap as $oldID => $newOutputID)
{
$this->dao->update(TABLE_AUDITCL)->set('objectID')->eq($newOutputID)->where('objectID')->eq($oldID)->andWhere('workflowGroup')->eq($groupID)->exec();