* [misc] calling dao to update tables instead of calling dbh to trigger updating of dao cache.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user