* [refac] calling getResCache method to get data from cache.

This commit is contained in:
liugang
2024-12-30 09:42:38 +08:00
committed by 朱金勇
parent 1a85d38b8a
commit e8d99c17da
2 changed files with 3 additions and 14 deletions
+2 -7
View File
@@ -48,6 +48,7 @@ class projectModel extends model
return $projects ?: [];
}
/**
* 根据权限控制范围和类型获取项目。
* Get projects by acl and type.
@@ -68,13 +69,7 @@ class projectModel extends model
return $projects;
}
$projects = $this->mao->key(CACHE_PROJECT_ACL, $acl, $type)->get();
if(!$projects)
{
$projects = $this->dao->select('id, project, type, parent, path, openedBy, PO, PM, QD, RD, acl')->from(TABLE_PROJECT)->where('acl')->eq($acl)->andWhere('type')->eq($type)->fetchAll('id');
$this->mao->save($projects);
}
return $projects ?: [];
return $this->mao->getResCache(CACHE_PROJECT_ACL, ['acl' => $acl, 'type' => $type], TABLE_PROJECT, 'id, project, type, parent, path, openedBy, PO, PM, QD, RD, acl');
}
/**