mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-10 00:22:48 +08:00
改进Query类的update和delete的缓存key判断
This commit is contained in:
@@ -1777,7 +1777,9 @@ class Query
|
|||||||
// 如果存在主键数据 则自动作为更新条件
|
// 如果存在主键数据 则自动作为更新条件
|
||||||
if (is_string($pk) && isset($data[$pk])) {
|
if (is_string($pk) && isset($data[$pk])) {
|
||||||
$where[$pk] = $data[$pk];
|
$where[$pk] = $data[$pk];
|
||||||
|
if (!isset($key)) {
|
||||||
$key = 'think:' . $options['table'] . '|' . $data[$pk];
|
$key = 'think:' . $options['table'] . '|' . $data[$pk];
|
||||||
|
}
|
||||||
unset($data[$pk]);
|
unset($data[$pk]);
|
||||||
} elseif (is_array($pk)) {
|
} elseif (is_array($pk)) {
|
||||||
// 增加复合主键支持
|
// 增加复合主键支持
|
||||||
@@ -2104,7 +2106,7 @@ class Query
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null($data) && true !== $data) {
|
if (!is_null($data) && true !== $data) {
|
||||||
if (!is_array($data)) {
|
if (!isset($key) && !is_array($data)) {
|
||||||
// 缓存标识
|
// 缓存标识
|
||||||
$key = 'think:' . $options['table'] . '|' . $data;
|
$key = 'think:' . $options['table'] . '|' . $data;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user