改进Query类delete方法的缓存标识读取

This commit is contained in:
thinkphp
2017-01-29 17:01:51 +08:00
parent e192f97a6d
commit 9a308b94e3

View File

@@ -2565,6 +2565,7 @@ class Query
{
// 分析查询表达式
$options = $this->parseExpress();
$pk = $this->getPk($options);
if (isset($options['cache']) && is_string($options['cache']['key'])) {
$key = $options['cache']['key'];
}
@@ -2576,6 +2577,8 @@ class Query
}
// AR模式分析主键条件
$this->parsePkWhere($data, $options);
} elseif (is_string($pk) && isset($options['where']['AND'][$pk]) && is_scalar($options['where']['AND'][$pk])) {
$key = 'think:' . $options['table'] . '|' . $options['where']['AND'][$pk];
}
if (true !== $data && empty($options['where'])) {