From 7c88ea6cdb326ff57428491eb9be9ecdb71e5c16 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 6 Apr 2023 05:22:14 +0000 Subject: [PATCH] * Fix error the global $dao variable is replaced with a new instance when call function loadModel. --- framework/base/model.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/base/model.class.php b/framework/base/model.class.php index 3375e88989..936bde692b 100644 --- a/framework/base/model.class.php +++ b/framework/base/model.class.php @@ -309,6 +309,8 @@ class baseModel public function loadDAO() { global $config, $dao; + if(is_object($dao)) return $this->dao = $dao; + $driver = $config->db->driver; if(!class_exists($driver))