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