make getPopularTags a tiny bit easier
This commit is contained in:
parent
0f481a99ea
commit
3f57237b88
1 changed files with 7 additions and 9 deletions
|
@ -550,14 +550,6 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService
|
||||||
$privacy = '';
|
$privacy = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_null($days) || !is_int($days)) {
|
|
||||||
$span = '';
|
|
||||||
} else {
|
|
||||||
$span = ' AND B.bDatetime > "'
|
|
||||||
. date('Y-m-d H:i:s', time() - (86400 * $days))
|
|
||||||
. '"';
|
|
||||||
}
|
|
||||||
|
|
||||||
$query = 'SELECT'
|
$query = 'SELECT'
|
||||||
. ' T.tag, COUNT(T.bId) AS bCount'
|
. ' T.tag, COUNT(T.bId) AS bCount'
|
||||||
. ' FROM '
|
. ' FROM '
|
||||||
|
@ -579,7 +571,13 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService
|
||||||
. ' AND B.bId = T.bId' . $privacy;
|
. ' AND B.bId = T.bId' . $privacy;
|
||||||
}
|
}
|
||||||
|
|
||||||
$query .= $span . ' AND LEFT(T.tag, 7) <> "system:"'
|
if (is_int($days)) {
|
||||||
|
$query .= ' AND B.bDatetime > "'
|
||||||
|
. date('Y-m-d H:i:s', time() - (86400 * $days))
|
||||||
|
. '"';
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= ' AND LEFT(T.tag, 7) <> "system:"'
|
||||||
. ' GROUP BY T.tag'
|
. ' GROUP BY T.tag'
|
||||||
. ' ORDER BY bCount DESC, tag';
|
. ' ORDER BY bCount DESC, tag';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue