Add support for time-based departmental progress tracking
- Introduced calculation of departmental progress for today, week, and month in `department_goals_o.php`. - Removed unnecessary blank line in `object_property.php` for code clarity.
This commit is contained in:
@@ -181,7 +181,6 @@ class object_property
|
||||
$db;
|
||||
$sql = "UPDATE $this->table SET $this->column = NULL WHERE id = $this->id";
|
||||
$db->query($sql);
|
||||
|
||||
if (defined('redis')) {
|
||||
redis->delete($this->getCacheKey());
|
||||
}
|
||||
|
||||
@@ -87,6 +87,11 @@ class department_goals_o extends db
|
||||
'progress' => [
|
||||
'value' => $include_progress ? goals_criteria::calculateProgressFromArray((array)$this->criteria->value()) : null,
|
||||
'departmental_distribution' => $include_progress ? goals_criteria::calculateDepartmentalProgressFromArray((array)$this->criteria->value()) : null,
|
||||
// array of department_id => [ 'all' => [ 'count' => int, 'target' => int ], 'today' => [ 'count' => int, 'target' => int ], 'week' => [ 'count' => int, 'target' => int ], 'month' => [ 'count' => int, 'target' => int ] ]
|
||||
// Showing progress for different time periods
|
||||
'today' => $include_progress ? goals_criteria::calculateProgressFromArray((array)$this->criteria->value(), 'today') : null,
|
||||
'week' => $include_progress ? goals_criteria::calculateProgressFromArray((array)$this->criteria->value(), 'week') : null,
|
||||
'month' => $include_progress ? goals_criteria::calculateProgressFromArray((array)$this->criteria->value(), 'month') : null,
|
||||
],
|
||||
'created_at' => (string)$this->created_at->value(),
|
||||
'updated_at' => (string)$this->updated_at->value(),
|
||||
|
||||
Reference in New Issue
Block a user