mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
修正Model类
This commit is contained in:
@@ -209,7 +209,7 @@ class Model
|
|||||||
throw new Exception('invalid data');
|
throw new Exception('invalid data');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($this->duplicate) && 'update' == $type) {
|
if (isset($find) && !empty($this->duplicate) && 'update' == $type) {
|
||||||
// 存在数据副本
|
// 存在数据副本
|
||||||
foreach ($data as $key => $val) {
|
foreach ($data as $key => $val) {
|
||||||
// 去除相同数据
|
// 去除相同数据
|
||||||
@@ -220,7 +220,7 @@ class Model
|
|||||||
if (empty($data)) {
|
if (empty($data)) {
|
||||||
// 没有数据变化
|
// 没有数据变化
|
||||||
return [];
|
return [];
|
||||||
} elseif (!empty($find)) {
|
} else {
|
||||||
// 更新操作保留主键信息
|
// 更新操作保留主键信息
|
||||||
$pk = $this->getPk();
|
$pk = $this->getPk();
|
||||||
if (is_array($pk)) {
|
if (is_array($pk)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user