diff --git a/module/common/model.php b/module/common/model.php index f33aa64335..9c576f7af2 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -808,7 +808,8 @@ class commonModel extends model $flow = $app->dbQuery('SELECT `table` FROM ' . TABLE_WORKFLOW . " WHERE `module`='$moduleName'")->fetch(); $default = $field->options[$newStatus]['default']; - $app->dbh->exec("UPDATE `$flow->table` SET `subStatus` = '$default' WHERE `id` = '$oldID'"); + $common = new self(); + $common->dao->update($flow->table)->set('subStatus')->eq($default)->where('id')->eq($oldID)->exec(); $new->subStatus = $default; } diff --git a/module/kanban/model.php b/module/kanban/model.php index 81b94a9920..200180920c 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -2454,7 +2454,7 @@ class kanbanModel extends model { if(empty($cardID)) continue; - $this->dbh->query("UPDATE " . TABLE_KANBANCELL. " SET `cards` = REPLACE(cards, ',$cardID,', ',') WHERE `type` = '$type' AND `kanban` = {$kanbanList[$cardID]}"); + $this->dao->update(TABLE_KANBANCELL)->set("cards = REPLACE(cards, ',$cardID,', ',')")->where('type')->eq($type)->andWhere('kanban')->eq($kanbanList[$cardID])->exec(); } $this->dao->update(TABLE_KANBANCELL) diff --git a/module/story/model.php b/module/story/model.php index cd40069e2d..3418effd48 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -591,7 +591,7 @@ class storyModel extends model public function relieveTwins(int $productID, int $storyID): bool { /* batchUnset twinID from twins.*/ - $this->dbh->exec("UPDATE " . TABLE_STORY . " SET twins = REPLACE(twins, ',$storyID,', ',') WHERE `product` = $productID"); + $this->dao->update(TABLE_STORY)->set("twins = REPLACE(twins, ',$storyID,', ',')")->where('product')->eq($productID)->exec(); /* Update twins to empty by twinID and if twins eq ','.*/ $this->dao->update(TABLE_STORY)->set('twins')->eq('')->where('id')->eq($storyID)->orWhere('twins')->eq(',')->exec();