From 3c2c1052c24fa4ca97c61fa32a499e6ec0ebc692 Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 24 May 2024 15:57:07 +0800 Subject: [PATCH] * baseDAO: fix error can't set cache for the updated table. --- lib/base/dao/dao.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index 8b7f97bb83..63cf2b26bd 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -991,6 +991,8 @@ class baseDAO /* Real-time save log. */ if(dao::$realTimeLog && dao::$realTimeFile) file_put_contents(dao::$realTimeFile, $sql . "\n", FILE_APPEND); + $table = $this->table; + $this->reset(); /* Force to query from master db, if db has been changed. */ @@ -998,11 +1000,11 @@ class baseDAO $result = $this->dbh->exec($sql); - if($this->table) + if($table) { /* 更新表的缓存时间。*/ /* Update the table cache time. */ - $table = str_replace(array('`', '"'), '', $this->table); + $table = str_replace(array('`', '"'), '', $table); $this->setCache($table); }