Skip to content

Commit

Permalink
Make selection of the period in the statistics more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntimeX committed Dec 13, 2024
1 parent c6048c5 commit 560572b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ public function getData()
$data = [];
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('objectTypeID IN (?)', [$this->parameters['objectTypeIDs']]);
$conditionBuilder->add('date BETWEEN ? AND ?', [$this->parameters['startDate'], $this->parameters['endDate']]);
if ($this->parameters['endDate'] < $this->parameters['startDate']) {
$conditionBuilder->add('date BETWEEN ? AND ?', [$this->parameters['endDate'], $this->parameters['startDate']]);
} else {
$conditionBuilder->add('date BETWEEN ? AND ?', [$this->parameters['startDate'], $this->parameters['endDate']]);
}

$limit = 0;
if ($this->parameters['dateGrouping'] == 'yearly') {
Expand Down

0 comments on commit 560572b

Please sign in to comment.