fix: [appTable:activityStatistics] Variation take for the activity of the last x days
parent
324ac1ce40
commit
6be08e3100
|
@ -107,9 +107,7 @@ class AppTable extends Table
|
||||||
$statistics['amount'] = $table->find()->all()->count();
|
$statistics['amount'] = $table->find()->all()->count();
|
||||||
if ($table->behaviors()->has('Timestamp') && $includeTimeline) {
|
if ($table->behaviors()->has('Timestamp') && $includeTimeline) {
|
||||||
$statistics['timeline'] = $this->buildTimeline($table, $days, $field);
|
$statistics['timeline'] = $this->buildTimeline($table, $days, $field);
|
||||||
$startCount = $table->find()->where(["{$field} >" => new \DateTime("-{$days} days")])->all()->count();
|
$statistics['variation'] = $table->find()->where(["{$field} >" => new \DateTime("-{$days} days")])->all()->count();
|
||||||
$endCount = $statistics['amount'];
|
|
||||||
$statistics['variation'] = $startCount - $endCount;
|
|
||||||
} else {
|
} else {
|
||||||
$statistics['timeline'] = [];
|
$statistics['timeline'] = [];
|
||||||
$statistics['variation'] = 0;
|
$statistics['variation'] = 0;
|
||||||
|
|
Loading…
Reference in New Issue