formatting

This commit is contained in:
Shish 2020-02-05 01:38:32 +00:00
parent 342f30142b
commit 23943692ce

View File

@ -898,11 +898,7 @@ class Image
// no tags, do a simple search // no tags, do a simple search
if ($positive_tag_count === 0 && $negative_tag_count === 0) { if ($positive_tag_count === 0 && $negative_tag_count === 0) {
$query = new Querylet(" $query = new Querylet("SELECT images.* FROM images WHERE 1=1");
SELECT images.*
FROM images
WHERE 1=1
");
} }
// one tag sorted by ID - we can fetch this from the image_tags table, // one tag sorted by ID - we can fetch this from the image_tags table,
@ -938,13 +934,10 @@ class Image
ORDER BY it.image_id DESC ORDER BY it.image_id DESC
LIMIT :limit OFFSET :offset LIMIT :limit OFFSET :offset
) a on a.image_id = images.id ) a on a.image_id = images.id
ORDER BY images.id DESC;
", ["limit"=>$limit, "offset"=>$offset]); ", ["limit"=>$limit, "offset"=>$offset]);
// don't do these at the image level because // don't offset at the image level because
// we did them at the image_tags level // we already offset at the image_tags level
$order = null; $offset = 0;
$limit = null;
$offset = null;
} }
} }
@ -962,11 +955,7 @@ class Image
if ($tag_count== 0) { if ($tag_count== 0) {
# one of the positive tags had zero results, therefor there # one of the positive tags had zero results, therefor there
# can be no results; "where 1=0" should shortcut things # can be no results; "where 1=0" should shortcut things
return new Querylet(" return new Querylet("SELECT images.* FROM images WHERE 1=0");
SELECT images.*
FROM images
WHERE 1=0
");
} elseif ($tag_count==1) { } elseif ($tag_count==1) {
// All wildcard terms that qualify for a single tag can be treated the same as non-wildcards // All wildcard terms that qualify for a single tag can be treated the same as non-wildcards
$positive_tag_id_array[] = $tag_ids[0]; $positive_tag_id_array[] = $tag_ids[0];