fix mysql

This commit is contained in:
Shish 2016-06-07 01:50:56 +01:00
parent 8e8a3da790
commit bfa1dc20c0

View File

@ -980,17 +980,6 @@ class Image {
) {
global $database;
// merge all the tag querylets into one generic one
$sql = "0";
$terms = array();
foreach($tag_querylets as $tq) {
$sign = $tq->positive ? "+" : "-";
$sql .= ' '.$sign.' IF(SUM(tag LIKE :tag'.Image::$tag_n.'), 1, 0)';
$terms['tag'.Image::$tag_n] = $tq->tag;
Image::$tag_n++;
}
$tag_search = new Querylet($sql, $terms);
// only negative tags - shortcut to fail
if($positive_tag_count == 0) {
// TODO: This isn't currently implemented.
@ -1002,6 +991,17 @@ class Image {
");
}
// merge all the tag querylets into one generic one
$sql = "0";
$terms = array();
foreach($tag_querylets as $tq) {
$sign = $tq->positive ? "+" : "-";
$sql .= ' '.$sign.' IF(tag LIKE :tag'.Image::$tag_n.', 1, 0)';
$terms['tag'.Image::$tag_n] = $tq->tag;
Image::$tag_n++;
}
$tag_search = new Querylet($sql, $terms);
$tag_id_array = array();
$x = 0;