Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/locker/data/dashboards/AdminDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function getStatementNumbersByDate(){
array('$group' => array(
'_id' => $set_id,
'count' => array('$sum' => 1),
'date' => array('$addToSet' => '$statement.stored'),
'date' => array('$addToSet' => '$statement.timestamp'),
'actor' => array('$addToSet' => '$statement.actor'))),
array('$sort' => array('_id' => 1)),
array('$project' => array('count' => 1, 'date' => 1, 'actor' => 1))
Expand Down
6 changes: 3 additions & 3 deletions app/locker/data/dashboards/LrsDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function actorCount(){
private function statementDays(){
$first_day = \DB::collection('statements')->first();
if( $first_day ){
$datetime1 = date_create( gmdate("Y-m-d", strtotime($first_day['statement']['stored']) ) );
$datetime1 = date_create( gmdate("Y-m-d", strtotime($first_day['statement']['timestamp']) ) );
$datetime2 = date_create( gmdate("Y-m-d", time()) );
$interval = date_diff($datetime1, $datetime2);
$days = $interval->days;
Expand Down Expand Up @@ -177,14 +177,14 @@ public function getStatementNumbersByDate(){
'$group' => array(
'_id' => $set_id,
'count' => array('$sum' => 1),
'date' => array('$addToSet' => '$statement.stored'),
'date' => array('$addToSet' => '$statement.timestamp'),
'actor' => array('$addToSet' => '$statement.actor')
)
),
array('$sort' => array('_id' => 1)),
array('$project' => array('count' => 1, 'date' => 1, 'actor' => 1))
);

//set statements for graphing
$data = '';
if( isset($statements['result']) ){
Expand Down
8 changes: 2 additions & 6 deletions app/locker/repository/Query/EloquentQueryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ public function selectStatements( $lrs='', $filter, $raw=false ){
/**
* Return data based on dates
*
* @todo if timestamp becomes required in the spec, we could use that to
* better reflect when the action actually happened, not when
* saved in the LRS, instead of $stored
*
* @param int $lrs
* @param array $filters e.g. date, from a date, between dates, including in / or
* @param string $interval e.g. dayOfYear, week, month, year etc
Expand Down Expand Up @@ -114,7 +110,7 @@ public function timedGrouping( $lrs, $filters, $interval, $type='time' ){
'$group' => array(
'_id' => $set_id,
'count' => array('$sum' => 1),
'date' => array('$addToSet' => '$statement.stored')
'date' => array('$addToSet' => '$statement.timestamp')
)
),
array('$sort' => array('date' => 1)),
Expand All @@ -127,7 +123,7 @@ public function timedGrouping( $lrs, $filters, $interval, $type='time' ){
'$group' => array(
'_id' => $set_id, //, 'dayOfYear' => '$created_at'
'count' => array('$sum' => 1),
'dates' => array('$addToSet' => '$statement.stored'),
'dates' => array('$addToSet' => '$statement.timestamp'),
'data' => $project
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public function count( $lrs ){
}

/**
* Return a list of statements ordered by stored desc
*
* Don't return voided statements, these are requested
* in a different call.
Expand Down