We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webman使用think-orm和think-cache 使用db的链式方法cache进行查询例如: model::where([xxx,xxx])->cache(true,60)->find(); 会报错
TypeError: Return value of think\\db\\PDOConnection::pdoQuery() must be of the type array, bool returned in ....
就是下面这个方法里面$data,当从缓存里面查询不到数据时候,变量值不只是null
/** * 执行查询 返回数据集 * @access protected * @param BaseQuery $query 查询对象 * @param mixed $sql sql指令 * @param array $bind 参数绑定 * @param bool $master 主库读取 * @return array * @throws DbException */ protected function pdoQuery(BaseQuery $query, $sql, array $bind = [], bool $master = null): array { // 分析查询表达式 $query->parseOptions(); if ($query->getOptions('cache')) { // 检查查询缓存 $cacheItem = $this->parseCache($query, $query->getOptions('cache')); $key = $cacheItem->getKey(); $data = $this->cache->get($key); // 当从缓存里面查询不到数据时候,$data值不只是null,还可能是false,只判断null会造成报错 if (null !== $data) { return $data; } }
The text was updated successfully, but these errors were encountered:
修复 issue top-think#468 db链式方法cache查询时判断和返回类型错误问题
c7f532d
No branches or pull requests
webman使用think-orm和think-cache
使用db的链式方法cache进行查询例如:
model::where([xxx,xxx])->cache(true,60)->find();
会报错
就是下面这个方法里面$data,当从缓存里面查询不到数据时候,变量值不只是null
The text was updated successfully, but these errors were encountered: