Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Fix branch filter in tracker trend model
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed Apr 15, 2015
1 parent eb3ddc5 commit 13a7933
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/tracker/models/pdo/TrendModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getMatch($producerId, $metricName, $configItemId, $testDatasetId
* @param null|string $startDate start date
* @param null|string $endDate end date
* @param null|int $userId user id
* @param null|string $branch branch name
* @param null|string|array $branch branch name
* @return array scalar DAOs
*/
public function getScalars($trendDao, $startDate = null, $endDate = null, $userId = null, $branch = null)
Expand All @@ -91,7 +91,11 @@ public function getScalars($trendDao, $startDate = null, $endDate = null, $userI
}

if (!is_null($branch)) {
$sql->where('branch = ?', $branch);
if (is_array($branch)) {
$sql->where('branch IN (?)', $branch);
} else {
$sql->where('branch = ?', $branch);
}
}

$scalarDaos = array();
Expand Down

0 comments on commit 13a7933

Please sign in to comment.