From 7ee775095d2adc4cd389edc86e92d0900b4323fe Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 11 Apr 2016 15:14:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Model=E7=B1=BB=E7=9A=84delete?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/db/Driver.php b/library/think/db/Driver.php index bf8b50e5..5921e219 100644 --- a/library/think/db/Driver.php +++ b/library/think/db/Driver.php @@ -1227,10 +1227,10 @@ abstract class Driver /** * 得到完整的数据表名 - * @access protected + * @access public * @return string */ - protected function getTableName() + public function getTableName() { if (!$this->table) { $tableName = $this->config['prefix']; @@ -2050,7 +2050,7 @@ abstract class Driver if (is_string($pk)) { // 根据主键查询 if (is_array($data)) { - $where[$pk] = ['in', $data]; + $where[$pk] = isset($data[$pk]) ? $data[$pk] : ['in', $data]; } else { $where[$pk] = strpos($data, ',') ? ['IN', $data] : $data; }