Skip to content

Commit

Permalink
Merge pull request #60 from wonder-game/develop
Browse files Browse the repository at this point in the history
feat: cacheGet增加mergeExt形参
  • Loading branch information
linkunyuan authored Oct 18, 2023
2 parents a83e11f + 9cfd9d9 commit 6f3be77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Common/OrmCache/Strings.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ public function cacheSet($id, $data = [], $bloom = false)
}, $this->redisPoolName);
}

public function cacheGet($id)
public function cacheGet($id, $mergeExt = null)
{
return RedisPool::invoke(function (Redis $redis) use ($id) {
return RedisPool::invoke(function (Redis $redis) use ($id, $mergeExt) {

if ($this->bloom) {
$bloomKey = $id;
Expand Down Expand Up @@ -261,7 +261,7 @@ public function cacheGet($id)
return false;
}
is_string($data) && $data = json_decode_ext($data);
$this->mergeExt && $data = $this->_mergeExt($data);
(is_null($mergeExt) ? $this->mergeExt : $mergeExt) && $data = $this->_mergeExt($data);
return $data;
}, $this->redisPoolName);
}
Expand Down

0 comments on commit 6f3be77

Please sign in to comment.