* finish task #6314.

This commit is contained in:
wangyidong
2019-09-04 09:02:11 +08:00
parent d2c577c6f6
commit c02ab53c02
+6
View File
@@ -236,6 +236,7 @@ class releaseModel extends model
public function linkStory($releaseID)
{
$release = $this->getByID($releaseID);
$product = $this->loadModel('product')->getByID($release->product);
$release->stories .= ',' . join(',', $this->post->stories);
$this->dao->update(TABLE_RELEASE)->set('stories')->eq($release->stories)->where('id')->eq((int)$releaseID)->exec();
@@ -244,7 +245,12 @@ class releaseModel extends model
$this->loadModel('story');
foreach($this->post->stories as $storyID)
{
/* Reset story stagedBy field for auto compute stage. */
$this->dao->update(TABLE_STORY)->set('stagedBy')->eq('')->where('id')->eq($storyID)->exec();
if($product->type != 'normal') $this->dao->update(TABLE_STORYSTAGE)->set('stagedBy')->eq('')->where('story')->eq($storyID)->andWhere('branch')->eq($release->branch)->exec();
$this->story->setStage($storyID);
$this->loadModel('action')->create('story', $storyID, 'linked2release', '', $releaseID);
}
}