From 99f995709e5d4ff6f21b42d0f32e9f9d903d4aa6 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 28 Jan 2022 10:51:06 +0800 Subject: [PATCH] * Fix work in process quantity issue. --- module/kanban/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index ffba476694..bed2a457bc 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -337,7 +337,7 @@ class kanbanModel extends model $column = $this->getColumnByID($columnID); $maxOrder = $this->dao->select('MAX(`order`) AS maxOrder')->from(TABLE_KANBANCOLUMN)->where('`group`')->eq($column->group)->fetch('maxOrder'); $order = $maxOrder ? $maxOrder + 1 : 1; - $sumChildLimit = $this->dao->select('SUM(`limit`) AS sumChildLimit')->from(TABLE_KANBANCOLUMN)->where('parent')->eq($columnID)->fetch('sumChildLimit'); + $sumChildLimit = 0; $childrenColumn = array(); foreach($data->name as $i => $name) @@ -363,7 +363,7 @@ class kanbanModel extends model return false; } - $sumChildLimit += $childColumn->limit; + $sumChildLimit += $childColumn->limit == -1 ? 0 : $childColumn->limit; if($column->limit != -1 and ($childColumn->limit == -1 or ($column->limit < $sumChildLimit))) { dao::$errors['limit'] = $this->lang->kanban->error->parentLimitNote;