* Finish task #56383

This commit is contained in:
zhouxudong
2022-06-08 08:02:47 +00:00
parent 596ea0124b
commit 0dc3a87d2e
2 changed files with 24 additions and 6 deletions
+16 -5
View File
@@ -3419,15 +3419,26 @@ class kanbanModel extends model
->andWhere('space')->in($spaceIdList)
->beginIF($kanbanIdList)->andWhere('id')->in($kanbanIdList)->fi()
->fetchGroup('space', 'id');
$kanbanIDList = array();
foreach($kanbanList as $kanbanPairs)
{
foreach($kanbanPairs as $kanban)
{
$cards = $this->dao->select('*')->from(TABLE_KANBANCARD)
->where('deleted')->eq(0)
->andWhere('kanban')->eq($kanban->id)
->fetchAll();
$kanban->cardsCount = count($cards);
$kanbanIDList[$kanban->id] = $kanban->id;
}
}
$cardsCount = $this->dao->select('kanban, COUNT(*) as count')->from(TABLE_KANBANCARD)
->where('deleted')->eq(0)
->andWhere('kanban')->in($kanbanIDList)
->groupBy('kanban')
->fetchPairs('kanban');
foreach($kanbanList as $kanbanPairs)
{
foreach($kanbanPairs as $kanban)
{
if(isset($cardsCount[$kanban->id])) $kanban->cardsCount = $cardsCount[$kanban->id];
}
}
return $kanbanList;
+8 -1
View File
@@ -153,7 +153,14 @@
</div>
<?php endif;?>
<div class='kanban-members-total pull-left'><?php echo sprintf($lang->kanban->teamSumCount, $teamCount);?></div>
<div class='kanban-members-total pull-right'><?php echo empty($kanban->cardsCount) ? $lang->kanban->noCard : sprintf($lang->kanban->cardsCount, $kanban->cardsCount)?></div>
<?php
$cardsCount = $lang->kanban->cardsCount;
if($kanban->cardsCount > 1)
{
$cardsCount = str_replace("card", "cards", $cardsCount);
}
?>
<div class='kanban-members-total pull-right'><?php echo empty($kanban->cardsCount) ? $lang->kanban->noCard : sprintf($cardsCount, $kanban->cardsCount)?></div>
</div>
</div>
</div>