From 9c4656cacfb025d03fc97145951fbcfefdcc1537 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Mon, 8 Apr 2024 17:15:21 +0800 Subject: [PATCH] + Add the method to get the hidden projects for the user. --- module/repo/tao.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/module/repo/tao.php b/module/repo/tao.php index 9db2217ee5..4b13bbd606 100644 --- a/module/repo/tao.php +++ b/module/repo/tao.php @@ -336,4 +336,25 @@ class repoTao extends repoModel $this->dao->insert(TABLE_REPOFILES)->data($copyFile)->exec(); } } + + /** + * Get the hidden projects for the user. + * + * @param string $user + * @return array + */ + protected function getHiddenProjects(string $user = '') + { + if(empty($user)) $user = 'system'; + + $hiddenProjects = $this->dao->select('`value`')->from(TABLE_CONFIG) + ->where('module')->eq('repo') + ->beginIF($user)->andWhere('owner')->eq($user)->fi() + ->andWhere('`key`')->eq('hiddenProjects') + ->fetch('value'); + + if($hiddenProjects) return json_decode($hiddenProjects, true); + + return array(); + } }