* [bug#54911,done,1h] update isParent for story.

This commit is contained in:
liumengyi
2024-09-20 10:23:47 +08:00
committed by 刘刚
parent a1719f7bff
commit c6b18aff86
2 changed files with 11 additions and 2 deletions
+5 -1
View File
@@ -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记录。 */
+6 -1
View File
@@ -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))