This commit is contained in:
孙广明
2022-01-25 17:02:23 +08:00
parent e797653a34
commit 287920c08f
+26 -1
View File
@@ -3007,7 +3007,32 @@ class kanbanModel extends model
if($column->parent)
{
$parent = $this->getColumnByID($column->parent);
if($parent->parent != -1) $this->dao->update(TABLE_KANBANCOLUMN)->set('parent')->eq(-1)->where('id')->eq($column->parent)->exec();
/* If the parent column is normal now, put its card into child column. */
if($parent->parent != -1)
{
$parentCells = $this->dao->select('*')->from(TABLE_KANBANCELL)
->where('`column`')->eq($column->parent)
->andWhere('type')->eq('common')
->fetchAll('id');
foreach($parentCells as $cell)
{
$this->dao->update(TABLE_KANBANCELL)->set('cards')->eq($cell->cards)
->where('lane')->eq($cell->lane)
->andWhere('`column`')->eq($columnID)
->andWhere('type')->eq('common')
->exec();
$this->dao->update(TABLE_KANBANCELL)->set('cards')->eq('')
->where('lane')->eq($cell->lane)
->andWhere('`column`')->eq($cell->column)
->andWhere('type')->eq('common')
->exec();
}
$this->dao->update(TABLE_KANBANCOLUMN)->set('parent')->eq(-1)->where('id')->eq($column->parent)->exec();
}
}
$this->dao->update(TABLE_KANBANCOLUMN)