* [task#122674,done,2h,0h] Filter out BRs and URs that have been closed after filtering those with open tags.

This commit is contained in:
hufangzhou
2024-07-10 15:48:16 +08:00
committed by 谢杞钰
parent dfd0786f58
commit 8106da9fa7
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -663,7 +663,14 @@ class productModel extends model
{
$unclosedStatus = $this->lang->story->statusList;
unset($unclosedStatus['closed']);
return $this->story->getProductStories($productID, $branch, $modules, array_keys($unclosedStatus), $type, $sort, true, '', $pager);
$stories = $this->story->getProductStories($productID, $branch, $modules, array_keys($unclosedStatus), $type, $sort, true, '', $pager);
foreach($stories as $storyID => $story)
{
if($story->type != 'story' && $story->stage == 'closed') unset($stories[$storyID]);
}
$this->app->loadClass('pager', true);
$pager = new pager(count($stories), $pager->recPerPage, $pager->pageID);
return $stories ? current(array_chunk($stories, $pager->recPerPage, true)) : array();
}
/* Set default function called, when browseType is (draftstory, activestory, changingstory, reviewingstory, closedstory, developingstory, launchedstory). */
+1
View File
@@ -35,6 +35,7 @@ cid=0
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/product.unittest.class.php';
zenData('product')->gen(5);
zenData('story')->gen(100);
$productIDList = array(1, 2, 3, 4, 5, 1000001);