diff --git a/module/action/model.php b/module/action/model.php index d52ae5787b..3c83334a68 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1361,7 +1361,11 @@ class actionModel extends model /* 还原已删除的需求时重算OR需求和业用研需的阶段。 */ /* The stage of recalculating OR requirements and industrial research needs when restoring deleted requirements. */ - if(in_array($action->objectType, array('story', 'epic', 'requirement'))) $this->loadModel('story')->setStage($action->objectID); + if(in_array($action->objectType, array('story', 'epic', 'requirement'))) + { + $this->loadModel('story')->setStage($action->objectID); + $this->story->updateParentStatus($action->objectID); + } if($action->objectType == 'demand' && !empty($object->parent)) $this->loadModel('demand')->updateParentDemandStage($object->parent); /* 在action表中更新action记录。 */ diff --git a/module/story/model.php b/module/story/model.php index fc1b2c1128..3e327af477 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -988,7 +988,12 @@ class storyModel extends model if($parentID <= 0) return true; $childrenStatus = $this->dao->select('id,status')->from(TABLE_STORY)->where('parent')->eq($parentID)->andWhere('deleted')->eq(0)->fetchPairs('status', 'status'); - if(empty($childrenStatus)) return true; + if(empty($childrenStatus)) + { + $this->dao->update(TABLE_STORY)->set('isParent')->eq('0')->where('id')->eq($parentID)->exec(); + return true; + } + $this->dao->update(TABLE_STORY)->set('isParent')->eq('1')->where('id')->eq($parentID)->exec(); $oldParentStory = $this->dao->select('*')->from(TABLE_STORY)->where('id')->eq($parentID)->andWhere('deleted')->eq(0)->fetch(); if(empty($oldParentStory))