* Add function of removeKanbanCell.

This commit is contained in:
xieqiyu
2022-01-21 11:15:54 +08:00
parent dde34eb36f
commit 2bfd25b610
+26
View File
@@ -492,6 +492,8 @@ class kanbanModel extends model
if(!dao::isError())
{
$this->removeKanbanCell('common', $importIDList);
$cards = implode(',', $importIDList);
$this->addKanbanCell($kanbanID, $targetLaneID, $columnID, 'common', $cards);
@@ -1999,6 +2001,30 @@ class kanbanModel extends model
}
}
/**
* Remove kanban cell.
*
* @param int|array $removeCardID
* @access public
* @return void
*/
public function removeKanbanCell($type, $removeCardID = 0)
{
if(is_array($removeCardID))
{
foreach($removeCardID as $cardID)
{
$this->dbh->query("UPDATE " . TABLE_KANBANCELL. " SET cards = REPLACE(cards, ',{$cardID},', ',') WHERE type = '$type'");
}
}
else
{
$this->dbh->query("UPDATE " . TABLE_KANBANCELL. " SET cards = REPLACE(cards, ',{$removeCardID},', ',') WHERE type = '$type'");
}
$this->dao->update(TABLE_KANBANCELL)->set('cards')->eq('')->where('cards')->eq(',')->andWhere('type')->eq($type)->exec();
}
/**
* Create a default RD kanban.
*