mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
优化自动缓存追加;
This commit is contained in:
@@ -37,15 +37,22 @@ class BaseModel extends Model
|
||||
}
|
||||
public static function autoRemoveCache($model)
|
||||
{
|
||||
static::$autoCache[] = [
|
||||
'name' => 'table',
|
||||
'type' => 'tag'
|
||||
];
|
||||
|
||||
|
||||
if(!isset(static::$autoCache['table'])){
|
||||
static::$autoCache['table'] = [
|
||||
'name' => 'table',
|
||||
'type' => 'tag'
|
||||
];
|
||||
}
|
||||
|
||||
if(!isset(static::$autoCache['read'])){
|
||||
static::$autoCache['read'] = [
|
||||
'name' => 'read',
|
||||
'field' => 'id'
|
||||
];
|
||||
}
|
||||
|
||||
static::$autoCache[] = [
|
||||
'name' => 'read',
|
||||
'field' => 'id'
|
||||
];
|
||||
|
||||
foreach (static::$autoCache as $cache_item) {
|
||||
$type = $cache_item['type'] ?? 'key';
|
||||
|
||||
Reference in New Issue
Block a user