Skip to content

Commit

Permalink
修复 issue top-think#468 db链式方法cache查询时判断和返回类型错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
shoujing1001 committed Mar 27, 2024
1 parent e35f497 commit c7f532d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/db/PDOConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,10 @@ protected function pdoQuery(BaseQuery $query, $sql, bool $master = null): array
$key = $cacheItem->getKey();

$data = $this->cache->get($key);

if (null !== $data) {
if (gettype($data) !== 'boolean' && null !== $data) {
return $data;
} else {
return [];
}
}
}
Expand Down

0 comments on commit c7f532d

Please sign in to comment.