Skip to content

Commit 8abf328

Browse files
authored
update时删除模型缓存
1 parent afab995 commit 8abf328

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Traits/MapperTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public function delete(array $ids): bool
318318
public function update(int $id, array $data): bool
319319
{
320320
$this->filterExecuteAttributes($data, true);
321-
return $this->model::find($id)->update($data) > 0;
321+
return $this->model::query(true)->where((new $this->model)->getKeyName(), $id)->update($data) > 0;
322322
}
323323

324324
/**

0 commit comments

Comments
 (0)