feat: channel sub

This commit is contained in:
2026-08-20 10:52:40 +07:00
parent 04be991865
commit 7031ed4d46
6 changed files with 75 additions and 13 deletions

View File

@@ -90,9 +90,7 @@ class ProductRepository:
*,
include_hidden: bool = False,
) -> int:
stmt = select(func.count()).select_from(Product).where(
Product.category_id == category_id
)
stmt = select(func.count()).select_from(Product).where(Product.category_id == category_id)
if not include_hidden:
stmt = stmt.where(Product.is_hidden.is_(False))
@@ -108,8 +106,10 @@ class ProductRepository:
) -> int:
ts_query = func.plainto_tsquery("simple", query)
stmt = select(func.count()).select_from(Product).where(
Product.search_vector.op("@@")(ts_query)
stmt = (
select(func.count())
.select_from(Product)
.where(Product.search_vector.op("@@")(ts_query))
)
if not include_hidden: