Skip to content

Commit b339258

Browse files
committed
Merge pull request #271 from LearningLocker/develop
More timestamp work
2 parents 9612b6d + 55000f0 commit b339258

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

app/locker/data/dashboards/AdminDashboard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getStatementNumbersByDate(){
145145
array('$group' => array(
146146
'_id' => $set_id,
147147
'count' => array('$sum' => 1),
148-
'date' => array('$addToSet' => '$statement.stored'),
148+
'date' => array('$addToSet' => '$statement.timestamp'),
149149
'actor' => array('$addToSet' => '$statement.actor'))),
150150
array('$sort' => array('_id' => 1)),
151151
array('$project' => array('count' => 1, 'date' => 1, 'actor' => 1))

app/locker/data/dashboards/LrsDashboard.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function actorCount(){
7070
private function statementDays(){
7171
$first_day = \DB::collection('statements')->first();
7272
if( $first_day ){
73-
$datetime1 = date_create( gmdate("Y-m-d", strtotime($first_day['statement']['stored']) ) );
73+
$datetime1 = date_create( gmdate("Y-m-d", strtotime($first_day['statement']['timestamp']) ) );
7474
$datetime2 = date_create( gmdate("Y-m-d", time()) );
7575
$interval = date_diff($datetime1, $datetime2);
7676
$days = $interval->days;
@@ -177,14 +177,14 @@ public function getStatementNumbersByDate(){
177177
'$group' => array(
178178
'_id' => $set_id,
179179
'count' => array('$sum' => 1),
180-
'date' => array('$addToSet' => '$statement.stored'),
180+
'date' => array('$addToSet' => '$statement.timestamp'),
181181
'actor' => array('$addToSet' => '$statement.actor')
182182
)
183183
),
184184
array('$sort' => array('_id' => 1)),
185185
array('$project' => array('count' => 1, 'date' => 1, 'actor' => 1))
186186
);
187-
187+
188188
//set statements for graphing
189189
$data = '';
190190
if( isset($statements['result']) ){

app/locker/repository/Query/EloquentQueryRepository.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ public function selectStatements( $lrs='', $filter, $raw=false ){
6969
/**
7070
* Return data based on dates
7171
*
72-
* @todo if timestamp becomes required in the spec, we could use that to
73-
* better reflect when the action actually happened, not when
74-
* saved in the LRS, instead of $stored
75-
*
7672
* @param int $lrs
7773
* @param array $filters e.g. date, from a date, between dates, including in / or
7874
* @param string $interval e.g. dayOfYear, week, month, year etc
@@ -114,7 +110,7 @@ public function timedGrouping( $lrs, $filters, $interval, $type='time' ){
114110
'$group' => array(
115111
'_id' => $set_id,
116112
'count' => array('$sum' => 1),
117-
'date' => array('$addToSet' => '$statement.stored')
113+
'date' => array('$addToSet' => '$statement.timestamp')
118114
)
119115
),
120116
array('$sort' => array('date' => 1)),
@@ -127,7 +123,7 @@ public function timedGrouping( $lrs, $filters, $interval, $type='time' ){
127123
'$group' => array(
128124
'_id' => $set_id, //, 'dayOfYear' => '$created_at'
129125
'count' => array('$sum' => 1),
130-
'dates' => array('$addToSet' => '$statement.stored'),
126+
'dates' => array('$addToSet' => '$statement.timestamp'),
131127
'data' => $project
132128
),
133129
),

app/locker/repository/Statement/EloquentStatementRepository.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function count( $lrs ){
4040
}
4141

4242
/**
43-
* Return a list of statements ordered by stored desc
4443
*
4544
* Don't return voided statements, these are requested
4645
* in a different call.

0 commit comments

Comments
 (0)