Merge branch 'sprint/193_hufangzhou_branch' into 'master'

* Handle modules without non-trunk branches.

See merge request easycorp/zentaopms!3672
This commit is contained in:
朱金勇
2022-05-31 09:45:10 +00:00
+1
View File
@@ -5719,6 +5719,7 @@ class upgradeModel extends model
public function updateObjectBranch()
{
$moduleBranchPairs = $this->dao->select('id,branch')->from(TABLE_MODULE)->where('branch')->ne(0)->fetchPairs();
if(empty($moduleBranchPairs)) return true;
$storyModulePairs = $this->dao->select('module')->from(TABLE_STORY)->where('module')->in(array_keys($moduleBranchPairs))->andWhere('branch')->eq(0)->fetchPairs();
foreach($storyModulePairs as $moduleID) $this->dao->update(TABLE_STORY)->set('`branch`')->eq($moduleBranchPairs[$moduleID])->where('module')->eq($moduleID)->exec();