From 1633dfb3aac0b3eafecdf03a71928718e5d144d2 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 2 Nov 2015 08:38:17 +0800 Subject: [PATCH] * adjust for productplan link story. --- module/productplan/model.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index 0d80894d09..7de6634094 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -204,7 +204,15 @@ class productplanModel extends model $this->loadModel('action'); foreach($this->post->stories as $storyID) { - $this->dao->update(TABLE_STORY)->set("plan=CONCAT(plan, ',', $planID)")->where('id')->eq((int)$storyID)->exec(); + if($this->session->currentProductType == 'normal') + { + $this->dao->update(TABLE_STORY)->set("plan")->eq($planID)->where('id')->eq((int)$storyID)->exec(); + } + else + { + $this->dao->update(TABLE_STORY)->set("plan")->eq($planID)->where('id')->eq((int)$storyID)->andWhere('branch')->ne('0')->exec(); + $this->dao->update(TABLE_STORY)->set("plan=CONCAT(plan, ',', $planID)")->where('id')->eq((int)$storyID)->andWhere('branch')->eq('0')->exec(); + } $this->action->create('story', $storyID, 'linked2plan', '', $planID); $this->story->setStage($storyID); }