This commit is contained in:
tianshujie
2022-09-05 13:07:33 +08:00
parent 28a3491819
commit 9ef6b56e2c
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -930,7 +930,8 @@ class productplanModel extends model
->fetchPairs();
if(isset($branchPlanPairs[$plan->branch])) $branchPlanPairs[$plan->branch] = $planID;
$plansOfStory = ',' . implode(',', $branchPlanPairs);
$plansOfStory = implode(',', $branchPlanPairs);
$plansOfStory = trim($plansOfStory, ',');
$this->dao->update(TABLE_STORY)->set("plan")->eq($plansOfStory)->where('id')->eq((int)$storyID)->exec();
+1 -1
View File
@@ -1976,7 +1976,7 @@ class storyModel extends model
{
if(!empty($oldStory->plan) and isset($branchPlanPairs[$plan->branch]) and $branchPlanPairs[$plan->branch] != $planID) $unlinkPlans[$branchPlanPairs[$plan->branch]] = empty($unlinkPlans[$branchPlanPairs[$plan->branch]]) ? $storyID : "{$unlinkPlans[$branchPlanPairs[$plan->branch]]},$storyID";
if(isset($branchPlanPairs[$plan->branch])) $branchPlanPairs[$plan->branch] = $planID;
$story->plan = $oldStory->plan ? ',' . implode(',', $branchPlanPairs) : $planID;
$story->plan = $oldStory->plan ? implode(',', $branchPlanPairs) : $planID;
$story->plan = trim($story->plan, ',');
if($story->plan != $oldStory->plan and !empty($planID)) $link2Plans[$planID] = empty($link2Plans[$planID]) ? $storyID : "{$link2Plans[$planID]},$storyID";
}