From 535f66d8e220e4d37fba4ceb3bab39c5d5b57a34 Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 16 May 2025 10:56:25 +0800 Subject: [PATCH] * [refac] calling the descTable method to get the information of table fields. --- lib/base/dao/dao.class.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index 13035a73a6..759a0bb9da 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -1771,19 +1771,8 @@ class baseDAO */ public function getFieldsType() { - try - { - $this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); - $sql = "DESC $this->table"; - $rawFields = $this->dbh->rawQuery($sql)->fetchAll(); - $this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL); - } - catch (PDOException $e) - { - $this->sqlError($e); - } - - $fields = array(); + $fields = array(); + $rawFields = $this->descTable($this->table); foreach($rawFields as $rawField) { $firstPOS = strpos($rawField->type, '(');