From ec9c9f2a0e4c6430483b06d1235637ddff781280 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 7 Jul 2022 13:32:34 +0800 Subject: [PATCH] * fix bug #24937 --- module/story/model.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index 175726a30b..bb6081350c 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4086,15 +4086,14 @@ class storyModel extends model $group = array(); foreach($relations as $relation) $group[$relation->AID][] = $relation->BID; - foreach($stories as $story) { - if(!isset($group[$story->id])) - { - unset($stories[$story->id]); - continue; - } + if(!isset($group[$story->id])) continue; $story->children = $this->getByList($group[$story->id]); + array_map(function($storyID) use(&$stories) + { + unset($stories[$storyID]); + }, $group[$story->id]); } }