From 991e27e873fa846d4b915fb8b59aaf276e4ae586 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 26 Dec 2024 16:49:26 +0800 Subject: [PATCH] * [refac] get data from cache by fetchAll method instead of getResCache method. --- module/product/model.php | 2 +- module/project/model.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index 1b4e10ee77..5f53709149 100755 --- a/module/product/model.php +++ b/module/product/model.php @@ -65,7 +65,7 @@ class productModel extends model */ public function getListByAcl(string $acl): array { - return $this->mao->getResCache(CACHE_PRODUCT_LIST, ['acl' => $acl], TABLE_PRODUCT, 'id, program, PO, QD, RD, feedback, ticket, acl, whitelist, reviewer, PMT, createdBy'); + return $this->mao->select('id, program, PO, QD, RD, feedback, ticket, acl, whitelist, reviewer, PMT, createdBy')->from(TABLE_PRODUCT)->where('acl')->eq($acl)->fetchAll('id'); } /** diff --git a/module/project/model.php b/module/project/model.php index c4707e8f99..6c25e6d779 100755 --- a/module/project/model.php +++ b/module/project/model.php @@ -19,7 +19,7 @@ class projectModel extends model return $acls; } - return $this->mao->getResCache(CACHE_ACL_LIST, ['objectType' => $objectType], TABLE_ACL, 'id, account, objectType, objectID'); + return $this->mao->select('id, account, objectType, objectID')->from(TABLE_ACL)->where('objectType')->eq($objectType)->fetchAll('id'); } /** @@ -69,7 +69,7 @@ class projectModel extends model return $projects; } - return $this->mao->getResCache(CACHE_PROJECT_LIST, ['acl' => $acl, 'type' => $type], TABLE_PROJECT, 'id, project, type, parent, path, openedBy, PO, PM, QD, RD, acl'); + return $this->mao->select('id, project, type, parent, path, openedBy, PO, PM, QD, RD, acl')->from(TABLE_PROJECT)->where('type')->eq($type)->andWhere('acl')->eq($acl)->fetchAll('id'); } /** @@ -91,7 +91,7 @@ class projectModel extends model return $teams; } - return $this->mao->getResCache(CACHE_TEAM_LIST, ['type' => $type], TABLE_TEAM, 'id, root, type, account'); + return $this->mao->select('id, root, type, account')->from(TABLE_TEAM)->where('type')->eq($type)->fetchAll('id'); } /**