5.0.0 - 致命 - 已处理
版本号: Thinkphp6.0.12废话不说, 直接上代码
Db::name('project_comment')->json(['img'])->where('pid', '=', $project_id)->order('id', 'desc')->cacheAlways('test_key',Time::secondDay())->paginate(['list_rows' => 15, 'query' => request()->param()])
这个代码里, 同时使用了paginate和cache以后, 只要自定义cache的key, 就会报错.如果不自定义key就是正常的.错误如下:
#0 [0]TypeError in PDOConnection.php line 695
think\db\PDOConnection::pdoQuery(): Return value must be of type array, string returned
if ($query->getOptions('cache')) {
// 检查查询缓存
$cacheItem = $this->parseCache($query, $query->getOptions('cache'));
$key = $cacheItem->getKey();
$data = $this->cache->get($key);
if (null !== $data) {
return $data;
}
}
if ($sql instanceof Closure) {
$sql = $sql($query);
$bind = $query->getBind();
}
if (!isset($master)) {
致命错误,静待更新. 需要了解其他情况, 请随时联系我.QQ:252333696
Email:javachina@foxmail.com