This commit is contained in:
tianshujie98
2020-09-25 16:26:10 +08:00
parent 37247db1ef
commit a70c2d0fad
+7 -10
View File
@@ -1383,17 +1383,14 @@ class storyModel extends model
$story->plan = trim(str_replace(",$oldPlanID,", ',', ",$oldStory->plan,"), ',');
if(empty($story->branch)) $story->plan .= ",$planID";
}
if($planID and $this->session->currentProductType != 'normal' and $oldStory->branch == 0)
if($planID and $this->session->currentProductType != 'normal' and $oldStory->branch == 0 and !isset($oldStoryStages[$storyID][$plan->branch]))
{
if(!isset($oldStoryStages[$storyID][$plan->branch]))
{
$story->stage = 'planned';
$newStoryStage = new stdclass();
$newStoryStage->story = $storyID;
$newStoryStage->branch = $plan->branch;
$newStoryStage->stage = $story->stage;
$this->dao->insert(TABLE_STORYSTAGE)->data($newStoryStage)->autoCheck()->exec();
}
$story->stage = 'planned';
$newStoryStage = new stdclass();
$newStoryStage->story = $storyID;
$newStoryStage->branch = $plan->branch;
$newStoryStage->stage = $story->stage;
$this->dao->insert(TABLE_STORYSTAGE)->data($newStoryStage)->autoCheck()->exec();
}
$this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec();