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

Commit 13a7933

Browse files
author
Jamie Snape
committed
Fix branch filter in tracker trend model
1 parent eb3ddc5 commit 13a7933

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/tracker/models/pdo/TrendModel.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function getMatch($producerId, $metricName, $configItemId, $testDatasetId
7272
* @param null|string $startDate start date
7373
* @param null|string $endDate end date
7474
* @param null|int $userId user id
75-
* @param null|string $branch branch name
75+
* @param null|string|array $branch branch name
7676
* @return array scalar DAOs
7777
*/
7878
public function getScalars($trendDao, $startDate = null, $endDate = null, $userId = null, $branch = null)
@@ -91,7 +91,11 @@ public function getScalars($trendDao, $startDate = null, $endDate = null, $userI
9191
}
9292

9393
if (!is_null($branch)) {
94-
$sql->where('branch = ?', $branch);
94+
if (is_array($branch)) {
95+
$sql->where('branch IN (?)', $branch);
96+
} else {
97+
$sql->where('branch = ?', $branch);
98+
}
9599
}
96100

97101
$scalarDaos = array();

0 commit comments

Comments
 (0)