From 3076ba22dd8346725b4e1ad757532c00df5b18d9 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 2 Jan 2015 17:19:13 -0500 Subject: Fix bugs, improve perfs and use SimpleLogger instead of Monolog --- app/Model/Board.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app/Model/Board.php') diff --git a/app/Model/Board.php b/app/Model/Board.php index 5ebec279..550009fa 100644 --- a/app/Model/Board.php +++ b/app/Model/Board.php @@ -253,6 +253,23 @@ class Board extends Base return $swimlanes; } + /** + * Get the total of tasks per column + * + * @access public + * @param integer $project_id + * @return array + */ + public function getColumnStats($project_id) + { + return $this->db + ->table(Task::TABLE) + ->eq('project_id', $project_id) + ->eq('is_active', 1) + ->groupBy('column_id') + ->listing('column_id', 'COUNT(*) AS total'); + } + /** * Get the first column id for a given project * -- cgit v1.2.3