From 05ae463eab17fc38d22525a97de0e8a647799257 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Mon, 21 Nov 2022 08:38:44 +0800 Subject: [PATCH] * Adjust code of DAO. --- lib/base/dao/dao.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index 9cc7d2f99f..c06499ceb3 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -710,19 +710,19 @@ class baseDAO */ public function getColumns($stmt) { - /* 如果是SQL查询语句,先执行查询获得 PDO stmt. */ - /* If it is SQL string, query to get PDO stmt. */ + /* 如果$stmt是SQL查询语句,先执行查询获得 PDO stmt. */ + /* If $stmt is a SQL string, query to get PDO stmt. */ if(is_string($stmt)) $stmt = $this->query($stmt); - $fields = array(); try { + $columns = array(); for($columnIndex = 0; $columnIndex < $stmt->columnCount(); $columnIndex++) { - $fields[] = $stmt->getColumnMeta($columnIndex); + $columns[] = $stmt->getColumnMeta($columnIndex); } - return $fields; + return $columns; } catch (PDOException $e) {