From 9fb53917502ab777c1c7c6c95f6254643dd5fffb Mon Sep 17 00:00:00 2001 From: JanHuang Date: Fri, 29 Mar 2019 14:18:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Model/Database.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Model/Database.php b/src/Model/Database.php index a52f700e..b4c9e557 100644 --- a/src/Model/Database.php +++ b/src/Model/Database.php @@ -53,37 +53,34 @@ public function reconnect() $this->__construct($this->config); } + /** * @param $query - * - * @return bool|\PDOStatement + * @return bool|false|\PDOStatement */ public function query($query) { try { - return parent::query($query); + return $this->pdo->query($query); } catch (Exception $e) { $this->reconnect(); - return parent::query($query); + return $this->pdo->query($query); } } /** * @param $query - * * @return bool|int - * - * @throws \ErrorException */ public function exec($query) { try { - return parent::exec($query); + return $this->pdo->exec($query); } catch (Exception $e) { $this->reconnect(); - return parent::exec($query); + return $this->pdo->exec($query); } }