From b78f12d5cd50ce099100d64c2854786115527489 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Wed, 28 May 2025 04:36:44 +0000 Subject: [PATCH 1/2] * [bug#62797,done,0.2h] fix bug. --- module/story/model.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index 054fa4f2da..5d98009f0b 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1771,18 +1771,18 @@ class storyModel extends model $allChanges[$storyID] = common::createChanges($oldStory, $story); if($story->plan != $oldStory->plan and !empty($oldStory->plan) and $oldStory->type == 'story') { - foreach(explode(',', (string)$oldStory->plan) as $planID) + foreach(explode(',', (string)$oldStory->plan) as $oldPlanID) { - if(!$planID) continue; - $unlinkPlans[$planID] = empty($unlinkPlans[$planID]) ? $storyID : "{$unlinkPlans[$planID]},$storyID"; + if(!$oldPlanID) continue; + $unlinkPlans[$oldPlanID] = empty($unlinkPlans[$oldPlanID]) ? $storyID : "{$unlinkPlans[$oldPlanID]},$storyID"; } } if($story->plan != $oldStory->plan and !empty($story->plan)) { - foreach(explode(',', (string)$story->plan) as $planID) + foreach(explode(',', (string)$story->plan) as $newPlanID) { - if(!$planID) continue; - $link2Plans[$planID] = empty($link2Plans[$planID]) ? $storyID : "{$link2Plans[$planID]},$storyID"; + if(!$newPlanID) continue; + $link2Plans[$newPlanID] = empty($link2Plans[$newPlanID]) ? $storyID : "{$link2Plans[$newPlanID]},$storyID"; } } } From d5cf737ce0cd3f063daabb37e8e569b5a89a9b21 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Wed, 28 May 2025 05:12:54 +0000 Subject: [PATCH 2/2] * [unittest] modify unit test. --- module/story/test/model/batchchangeplan.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/module/story/test/model/batchchangeplan.php b/module/story/test/model/batchchangeplan.php index fb1ad44615..772ec505ee 100755 --- a/module/story/test/model/batchchangeplan.php +++ b/module/story/test/model/batchchangeplan.php @@ -8,18 +8,18 @@ timeout=0 cid=0 - 批量修改6个需求的计划,查看被修改计划的需求数量 @4 -- 批量修改6个需求的计划,查看被修改计划的需求数量 @3 +- 批量修改6个需求的计划,查看被修改计划的需求数量 @4 - 批量修改6个需求的计划,查看需求1修改后的计划ID第1条的plan属性 @10 - 批量修改6个需求的计划,查看需求2修改后的计划ID第2条的plan属性 @10 - 批量修改6个需求的计划,查看需求4修改后的计划ID第4条的plan属性 @2,10 - 批量修改6个需求的计划,查看需求5修改后的计划ID第5条的plan属性 @10 - 批量修改6个需求的计划,查看需求1修改后的计划ID第1条的plan属性 @10,9 - 批量修改6个需求的计划,查看需求2修改后的计划ID第2条的plan属性 @9 -- 批量修改6个需求的计划,查看需求4修改后的计划ID第4条的plan属性 @2,10 +- 批量修改6个需求的计划,查看需求4修改后的计划ID第4条的plan属性 @2,9 - 批量修改6个需求的计划,查看需求1修改后的计划ID第1条的plan属性 @10,9,5 - 批量修改6个需求的计划,查看需求2修改后的计划ID第2条的plan属性 @5 -- 批量修改6个需求的计划,查看需求4修改后的计划ID第4条的plan属性 @2,10,5 -- 批量修改6个需求的计划,查看需求5修改后的计划ID第5条的plan属性 @10,5 +- 批量修改6个需求的计划,查看需求4修改后的计划ID第4条的plan属性 @2,5 +- 批量修改6个需求的计划,查看需求5修改后的计划ID第5条的plan属性 @10,9,5 */ include dirname(__FILE__, 5) . '/test/lib/init.php'; @@ -51,15 +51,15 @@ $stories2 = $story->batchChangePlanTest($storyIdList, 9); $stories3 = $story->batchChangePlanTest($storyIdList, 5, 9); r(count($stories1)) && p() && e('4'); // 批量修改6个需求的计划,查看被修改计划的需求数量 -r(count($stories2)) && p() && e('3'); // 批量修改6个需求的计划,查看被修改计划的需求数量 +r(count($stories2)) && p() && e('4'); // 批量修改6个需求的计划,查看被修改计划的需求数量 r($stories1) && p('1:plan') && e('10'); // 批量修改6个需求的计划,查看需求1修改后的计划ID r($stories1) && p('2:plan') && e('10'); // 批量修改6个需求的计划,查看需求2修改后的计划ID r($stories1) && p('4:plan', '|') && e('2,10'); // 批量修改6个需求的计划,查看需求4修改后的计划ID r($stories1) && p('5:plan') && e('10'); // 批量修改6个需求的计划,查看需求5修改后的计划ID r($stories2) && p('1:plan', '|') && e('10,9'); // 批量修改6个需求的计划,查看需求1修改后的计划ID r($stories2) && p('2:plan') && e('9'); // 批量修改6个需求的计划,查看需求2修改后的计划ID -r($stories2) && p('4:plan', '|') && e('2,10'); // 批量修改6个需求的计划,查看需求4修改后的计划ID +r($stories2) && p('4:plan', '|') && e('2,9'); // 批量修改6个需求的计划,查看需求4修改后的计划ID r($stories3) && p('1:plan', '|') && e('10,9,5'); // 批量修改6个需求的计划,查看需求1修改后的计划ID r($stories3) && p('2:plan') && e('5'); // 批量修改6个需求的计划,查看需求2修改后的计划ID -r($stories3) && p('4:plan', '|') && e('2,10,5'); // 批量修改6个需求的计划,查看需求4修改后的计划ID -r($stories3) && p('5:plan', '|') && e('10,5'); // 批量修改6个需求的计划,查看需求5修改后的计划ID \ No newline at end of file +r($stories3) && p('4:plan', '|') && e('2,5'); // 批量修改6个需求的计划,查看需求4修改后的计划ID +r($stories3) && p('5:plan', '|') && e('10,9,5'); // 批量修改6个需求的计划,查看需求5修改后的计划ID \ No newline at end of file