summaryrefslogtreecommitdiff
path: root/app/Model/SubtaskModel.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/SubtaskModel.php')
-rw-r--r--app/Model/SubtaskModel.php9
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
*