改进Model类delete方法

This commit is contained in:
thinkphp
2017-02-13 19:02:18 +08:00
parent 0fa7dd3f85
commit bc1bd1b742

View File

@@ -1081,7 +1081,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
// 删除条件
$pk = $this->getPk();
if (isset($this->data[$pk])) {
if (is_string($pk) && isset($this->data[$pk])) {
$where = [$pk => $this->data[$pk]];
} elseif (!empty($this->updateWhere)) {
$where = $this->updateWhere;