Add task analytics

This commit is contained in:
Frederic Guillot
2015-07-05 16:07:21 -04:00
parent 67b9a56469
commit bb8b4c0e36
18 changed files with 186 additions and 27 deletions

View File

@@ -38,6 +38,22 @@ class Transition extends Base
));
}
/**
* Get average time spent by task for each column
*
* @access public
* @param integer $task_id
* @return array
*/
public function getAverageTimeSpentByTask($task_id)
{
return $this->db
->hashtable(self::TABLE)
->groupBy('src_column_id')
->eq('task_id', $task_id)
->getAll('src_column_id', 'SUM(time_spent) AS time_spent');
}
/**
* Get all transitions by task
*