+ userTao: return empty array if the $projectIdList parameter is empty.
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user