diff --git a/app/locker/data/dashboards/AdminDashboard.php b/app/locker/data/dashboards/AdminDashboard.php index 4670941978..ba44282029 100644 --- a/app/locker/data/dashboards/AdminDashboard.php +++ b/app/locker/data/dashboards/AdminDashboard.php @@ -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)) diff --git a/app/locker/data/dashboards/LrsDashboard.php b/app/locker/data/dashboards/LrsDashboard.php index f58b1f6686..aba0d8a493 100644 --- a/app/locker/data/dashboards/LrsDashboard.php +++ b/app/locker/data/dashboards/LrsDashboard.php @@ -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; @@ -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']) ){ diff --git a/app/locker/repository/Query/EloquentQueryRepository.php b/app/locker/repository/Query/EloquentQueryRepository.php index 178b1b7e6f..b0f352df2d 100644 --- a/app/locker/repository/Query/EloquentQueryRepository.php +++ b/app/locker/repository/Query/EloquentQueryRepository.php @@ -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 @@ -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)), @@ -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 ), ), diff --git a/app/locker/repository/Statement/EloquentStatementRepository.php b/app/locker/repository/Statement/EloquentStatementRepository.php index dfa9bec1ca..d52989b353 100644 --- a/app/locker/repository/Statement/EloquentStatementRepository.php +++ b/app/locker/repository/Statement/EloquentStatementRepository.php @@ -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.