modify plugin name

This commit is contained in:
2022-03-01 17:16:53 +08:00
parent 1c7e0814b8
commit 918374f1b2
+6 -12
View File
@@ -574,7 +574,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
} }
$primary = $this->getPrimary(); $primary = $this->getPrimary();
if (!isset($param[$primary]) || empty($param[$primary])) { if (empty($param[$primary])) {
$this->setAttribute($primary, (int)$lastId); $this->setAttribute($primary, (int)$lastId);
} }
return $this; return $this;
@@ -710,17 +710,11 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
*/ */
private function separation(): array private function separation(): array
{ {
$_tmp = []; $assoc = array_diff_assoc($this->_oldAttributes, $this->_attributes);
$condition = [];
foreach ($this->_attributes as $key => $val) { $uassoc = array_intersect_assoc($this->_attributes, $this->_oldAttributes);
$oldValue = $this->_oldAttributes[$key] ?? NULL;
if ($val === $oldValue) { return [$assoc, $uassoc, array_keys($assoc)];
$condition[$key] = $val;
} else {
$_tmp[$key] = $val;
}
}
return [$_tmp, $condition, array_keys($_tmp)];
} }