+ userTao: return empty array if the $projectIdList parameter is empty.

This commit is contained in:
liugang
2023-12-25 13:44:35 +08:00
parent 4a56f867dc
commit f34c01c98b
+4
View File
@@ -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')