* [bug#54911,done,1h] update isParent for story.
This commit is contained in:
@@ -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记录。 */
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user