diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-04-08 13:58:25 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-04-08 13:58:25 -0400 |
commit | d7b0cfbbe57fae9afbf9637afa7e54d3bf708747 (patch) | |
tree | ced408d01329538bd34b659018a7cd11e04aa982 /app/Model/SubtaskModel.php | |
parent | fe9f3ba707d1caf9348ae17e0566eabd505fbce2 (diff) |
Improve dashboard
Diffstat (limited to 'app/Model/SubtaskModel.php')
-rw-r--r-- | app/Model/SubtaskModel.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/Model/SubtaskModel.php b/app/Model/SubtaskModel.php index 40cb517d..1e652ae2 100644 --- a/app/Model/SubtaskModel.php +++ b/app/Model/SubtaskModel.php @@ -88,6 +88,15 @@ class SubtaskModel extends Base ->asc(self::TABLE.'.position'); } + public function countByAssigneeAndTaskStatus($userId) + { + return $this->db->table(self::TABLE) + ->eq('user_id', $userId) + ->eq(TaskModel::TABLE.'.is_active', TaskModel::STATUS_OPEN) + ->join(Taskmodel::TABLE, 'id', 'task_id') + ->count(); + } + /** * Get all subtasks for a given task * |