From 4e0401b65cee9e33770b50465aa617c8ea9abeea Mon Sep 17 00:00:00 2001 From: sunguangming Date: Thu, 4 Jan 2024 10:53:41 +0800 Subject: [PATCH] * If dao error, return $this. --- lib/base/dao/dao.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index 61de783094..6163448579 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -760,9 +760,7 @@ class baseDAO */ public function query($sql = '') { - /* 如果有错误,返回一个空的PDOStatement对象,确保后续方法能够执行。*/ - /* If any error, return an empty statement object to make sure the remain method to execute. */ - if(!empty(dao::$errors)) return new PDOStatement(); + if(!empty(dao::$errors)) return $this; if($sql) { @@ -871,7 +869,7 @@ class baseDAO */ public function exec($sql = '') { - if(!empty(dao::$errors)) return new PDOStatement(); // If any error, return an empty statement object to make sure the remain method to execute. + if(!empty(dao::$errors)) return $this; if($sql) {