From f34c01c98bd390b9edcd3885e8738b95c6a05bdc Mon Sep 17 00:00:00 2001 From: liugang Date: Mon, 25 Dec 2023 13:44:35 +0800 Subject: [PATCH] + userTao: return empty array if the $projectIdList parameter is empty. --- module/user/tao.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/user/tao.php b/module/user/tao.php index 2d86871a19..460efad413 100644 --- a/module/user/tao.php +++ b/module/user/tao.php @@ -51,6 +51,8 @@ class userTao extends userModel */ public function fetchProjectExecutionCount(array $projectIdList): array { + if(!$projectIdList) return array(); + return $this->dao->select('project, COUNT(1) AS count')->from(TABLE_PROJECT) ->where('deleted')->eq('0') ->andWhere('multiple')->eq('1') @@ -71,6 +73,8 @@ class userTao extends userModel */ public function fetchProjectStoryEstimate(array $projectIdList): array { + if(!$projectIdList) return array(); + return $this->dao->select('t1.project, SUM(t3.estimate) AS estimate')->from(TABLE_PROJECT)->alias('t1') ->leftJoin(TABLE_PROJECTSTORY)->alias('t2')->on('t1.id = t2.project') ->leftJoin(TABLE_STORY)->alias('t3')->on('t2.story = t3.id')