fix mysql
This commit is contained in:
parent
8e8a3da790
commit
bfa1dc20c0
@ -980,17 +980,6 @@ class Image {
|
|||||||
) {
|
) {
|
||||||
global $database;
|
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
|
// only negative tags - shortcut to fail
|
||||||
if($positive_tag_count == 0) {
|
if($positive_tag_count == 0) {
|
||||||
// TODO: This isn't currently implemented.
|
// 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();
|
$tag_id_array = array();
|
||||||
|
|
||||||
$x = 0;
|
$x = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user