Skip to content

Commit

Permalink
修正Model类
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Apr 1, 2016
1 parent 732ddff commit b377d97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/think/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ protected function _write_data($data, $type)
throw new Exception('invalid data');
}
}
if (!empty($this->duplicate) && 'update' == $type) {
if (isset($find) && !empty($this->duplicate) && 'update' == $type) {
// 存在数据副本
foreach ($data as $key => $val) {
// 去除相同数据
Expand All @@ -220,7 +220,7 @@ protected function _write_data($data, $type)
if (empty($data)) {
// 没有数据变化
return [];
} elseif (!empty($find)) {
} else {
// 更新操作保留主键信息
$pk = $this->getPk();
if (is_array($pk)) {
Expand Down

0 comments on commit b377d97

Please sign in to comment.