summaryrefslogtreecommitdiff
path: root/services/searchhistoryservice.php
diff options
context:
space:
mode:
Diffstat (limited to 'services/searchhistoryservice.php')
-rw-r--r--services/searchhistoryservice.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/searchhistoryservice.php b/services/searchhistoryservice.php
index 7389906..bf678cf 100644
--- a/services/searchhistoryservice.php
+++ b/services/searchhistoryservice.php
@@ -43,7 +43,7 @@ class SearchHistoryService {
}
}
- function getAllSearches($range = NULL, $uId = NULL, $nb = NULL, $start = NULL, $distinct = false) {
+ function getAllSearches($range = NULL, $uId = NULL, $nb = NULL, $start = NULL, $distinct = false, $withResults = false) {
$sql = 'SELECT DISTINCT(shTerms), shId, shRange, shNbResults, shDatetime, uId';
$sql.= ' FROM '. $this->getTableName();
$sql.= ' WHERE 1=1';
@@ -55,6 +55,9 @@ class SearchHistoryService {
if($uId != NULL) {
$sql.= ' AND uId = '.$uId;
}
+ if($withResults = true) {
+ $sql.= ' AND shNbResults > 0';
+ }
if($distinct) {
$sql.= ' GROUP BY shTerms';
}