* [misc] calling dao to update tables instead of calling dbh to trigger updating of dao cache.

This commit is contained in:
liugang
2024-06-13 08:36:32 +00:00
committed by 王于听
parent a477e8e839
commit eda369fb1e
3 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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();