优化网站缓存;

This commit is contained in:
2022-02-14 22:54:35 +08:00
parent c4ac0764b9
commit 80f5b7cf27
5 changed files with 129 additions and 113 deletions

View File

@@ -43,15 +43,18 @@ trait AutoClearCache
$field = $cache_item['field'] ?? '';
$cache_key = $cache_item['name'] ?? '';
if (empty($cache_key)) {
continue;
}
if (!empty($field)) {
if (!is_null($model->$field)) {
$cache_key = $cache_key . '_' . $model->$field;
$cache_key = $cache_key . '_' . $model->getAttr($field);
}
}