* [refac] get data from cache by fetchAll method instead of getResCache method.

This commit is contained in:
liugang
2024-12-30 09:42:38 +08:00
committed by 朱金勇
parent 1cf13deb2e
commit 991e27e873
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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');
}
/**
+3 -3
View File
@@ -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');
}
/**