* Modify the logic of the batch change plan.

This commit is contained in:
tianshujie98
2020-09-28 14:49:31 +08:00
parent dcbb62059c
commit 0071e61933
+11 -7
View File
@@ -1298,14 +1298,18 @@ class storyModel extends model
if(empty($story->branch)) $story->plan .= ",$planID";
}
/* Fix bug #3529. */
if($planID and $this->session->currentProductType != 'normal' and $oldStory->branch == 0 and !isset($oldStoryStages[$storyID][$plan->branch]))
if($planID and $this->session->currentProductType != 'normal' and $oldStory->branch == 0)
{
$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->plan = $oldStory->plan ? $oldStory->plan . ',' . $planID : $planID;
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();
}
}
$this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec();