From f220bccb8f199221b1117fb13690fe0c4786a51d Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 6 Dec 2024 10:01:49 +0800 Subject: [PATCH] * [refac] if cache doesn't exist skip it. --- lib/base/mao/mao.class.php | 3 ++- lib/cache/cache.class.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/base/mao/mao.class.php b/lib/base/mao/mao.class.php index 4ed702a5cd..a02b372109 100644 --- a/lib/base/mao/mao.class.php +++ b/lib/base/mao/mao.class.php @@ -518,7 +518,8 @@ class baseMao { if($condition['field'] == $field && $condition['operator'] == 'eq') { - $rawResult[] = $this->cache->fetch($this->table, $condition['value']); + $result = $this->cache->fetch($this->table, $condition['value']); + if($result !== null) $rawResult[] = $result; break; } } diff --git a/lib/cache/cache.class.php b/lib/cache/cache.class.php index 65f11a9fde..b4b0ef389b 100644 --- a/lib/cache/cache.class.php +++ b/lib/cache/cache.class.php @@ -614,7 +614,7 @@ class cache if($object) return $object; $objects = $this->initTableCache(); - return isset($objects[$id]) ? $objects[$id] : false; + return isset($objects[$id]) ? $objects[$id] : null; } /**