no message

This commit is contained in:
kuaifan
2025-04-19 09:03:33 +08:00
parent b64d4fd96f
commit 63c6e12aca
7 changed files with 555 additions and 535 deletions

View File

@@ -220,13 +220,16 @@ class AbstractModel extends Model
$row = static::where($where)->first();
if (empty($row)) {
$row = new static;
if ($update instanceof \Closure) {
$update = $update();
}
if ($insert instanceof \Closure) {
$insert = $insert();
}
$array = array_merge($where, $insert ?: $update);
if (empty($insert)) {
if ($update instanceof \Closure) {
$update = $update();
}
$insert = $update;
}
$array = array_merge($where, $insert);
if (isset($array[$row->primaryKey])) {
unset($array[$row->primaryKey]);
}