修正Model类的delete方法

This commit is contained in:
thinkphp
2016-04-11 15:14:00 +08:00
parent 4fba18bc6c
commit 7ee775095d

View File

@@ -1227,10 +1227,10 @@ abstract class Driver
/** /**
* 得到完整的数据表名 * 得到完整的数据表名
* @access protected * @access public
* @return string * @return string
*/ */
protected function getTableName() public function getTableName()
{ {
if (!$this->table) { if (!$this->table) {
$tableName = $this->config['prefix']; $tableName = $this->config['prefix'];
@@ -2050,7 +2050,7 @@ abstract class Driver
if (is_string($pk)) { if (is_string($pk)) {
// 根据主键查询 // 根据主键查询
if (is_array($data)) { if (is_array($data)) {
$where[$pk] = ['in', $data]; $where[$pk] = isset($data[$pk]) ? $data[$pk] : ['in', $data];
} else { } else {
$where[$pk] = strpos($data, ',') ? ['IN', $data] : $data; $where[$pk] = strpos($data, ',') ? ['IN', $data] : $data;
} }