This commit is contained in:
2023-08-02 14:46:01 +08:00
parent bc36df50f8
commit d96f1c27a5
+1 -1
View File
@@ -456,7 +456,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
protected function updateInternal(array $old, array $condition, array $change): bool|static protected function updateInternal(array $old, array $condition, array $change): bool|static
{ {
$query = static::query()->where($condition); $query = static::query()->where($condition);
if (count($change)) { if (count($change) < 1) {
return true; return true;
} }
$generate = SqlBuilder::builder($query)->update($change); $generate = SqlBuilder::builder($query)->update($change);