diff --git a/module/report/model.php b/module/report/model.php index c876eef398..72620b7c44 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -369,14 +369,14 @@ class reportModel extends model */ public function getUserTasks() { - $tasks = $this->dao->select('t1.id, t1.name, t2.account as user') - ->from(TABLE_TASK)->alias('t1') - ->leftJoin(TABLE_USER)->alias('t2') - ->on('t1.assignedTo = t2.account') + $tasks = $this->dao->select('t1.id, t1.name, t2.account as user')->from(TABLE_TASK)->alias('t1') + ->leftJoin(TABLE_USER)->alias('t2')->on('t1.assignedTo = t2.account') + ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id') ->where('t1.assignedTo')->ne('') ->andWhere('t1.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) ->andWhere('t1.status')->in('wait, doing') + ->andWhere('t3.status')->ne('suspended') ->fetchGroup('user'); return $tasks;