Demographics page: count only 'gallery' photos

The photo stats were counting ALL public photos of certified members,
whether featured on the Site Gallery or not. Update the query to filter
for Site Gallery photos instead.
This commit is contained in:
Noah Petherbridge 2024-09-28 13:10:56 -07:00
parent 106bcd377e
commit c8d9cdbb3a
2 changed files with 2 additions and 1 deletions

View File

@ -278,6 +278,7 @@ func PhotoStatistics() Photo {
photos photos
JOIN users ON (photos.user_id = users.id) JOIN users ON (photos.user_id = users.id)
WHERE photos.visibility = 'public' WHERE photos.visibility = 'public'
AND photos.gallery IS TRUE
AND users.certified IS TRUE AND users.certified IS TRUE
AND users.status = 'active' AND users.status = 'active'
GROUP BY photos.explicit GROUP BY photos.explicit

View File

@ -210,7 +210,7 @@
{{range .Demographic.People.IterOrientations}} {{range .Demographic.People.IterOrientations}}
<div class="columns"> <div class="columns">
<div class="column is-3"> <div class="column is-3">
<strong>{{or .Label "(No answer)"}}</strong> <strong>{{or .Label "No answer"}}</strong>
<small class="has-text-grey">({{FormatNumberCommas .Count}})</small> <small class="has-text-grey">({{FormatNumberCommas .Count}})</small>
</div> </div>
<div class="column pt-4"> <div class="column pt-4">