From 2221769ed16c53a88278386e5386129df3fe6c10 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 21 Jan 2016 17:44:39 +0800 Subject: [PATCH] =?UTF-8?q?model=E7=B1=BB=E7=9A=84query=E5=92=8Cexecute?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=94=AF=E6=8C=81=E5=8F=82=E6=95=B0=E7=BB=91?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index 71f8bb17..bb6d934e 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1136,24 +1136,26 @@ class Model * SQL查询 * @access public * @param string $sql SQL指令 + * @param array $bind 参数绑定 * @return mixed */ - public function query($sql) + public function query($sql, $bind = []) { $sql = $this->parseSql($sql); - return $this->db->query($sql); + return $this->db->query($sql, $bind); } /** * 执行SQL语句 * @access public * @param string $sql SQL指令 + * @param array $bind 参数绑定 * @return false | integer */ - public function execute($sql) + public function execute($sql, $bind = []) { $sql = $this->parseSql($sql); - return $this->db->execute($sql); + return $this->db->execute($sql, $bind); } /**