fix set views "owned (unique)" card statistic

This commit is contained in:
Gered 2018-06-16 11:12:01 -04:00
parent 134b2082c4
commit 2007380ea1

View file

@ -15,10 +15,11 @@
where c.set_code = s.code where c.set_code = s.code
) as card_count, ) as card_count,
( (
select count(*) select count(distinct c.id)
from collection cl from collection cl
join cards c on cl.card_id = c.id join cards c on cl.card_id = c.id
where c.set_code = s.code and cl.quantity > 0 and cl.list_id = 0 where c.set_code = s.code
and cl.quantity > 0 and cl.list_id = 0
) as owned_count ) as owned_count
from sets s from sets s
where s.code = ?" code]) where s.code = ?" code])
@ -44,9 +45,10 @@
where c.set_code = s.code where c.set_code = s.code
) as card_count, ) as card_count,
( (
select count(*) select count(distinct c.id)
from collection cl from collection cl
join cards c on cl.card_id = c.id join cards c on cl.card_id = c.id
where c.set_code = s.code and cl.quantity > 0 and cl.list_id = 0 where c.set_code = s.code
and cl.quantity > 0 and cl.list_id = 0
) as owned_count ) as owned_count
from sets s"]) from sets s"])