fix(catalog): filter by Product.status == 'active'
This commit is contained in:
parent
1754f42878
commit
6eaa6739e2
1 changed files with 2 additions and 2 deletions
|
|
@ -1155,7 +1155,7 @@ def get_product_detail_by_slug(slug: str, db: Session = Depends(get_db)):
|
||||||
selectinload(Product.images),
|
selectinload(Product.images),
|
||||||
selectinload(Product.brand),
|
selectinload(Product.brand),
|
||||||
)
|
)
|
||||||
.where(Product.category_id == product.category_id, Product.product_id != product.product_id, Product.is_active == True)
|
.where(Product.category_id == product.category_id, Product.product_id != product.product_id, Product.status == "active")
|
||||||
)
|
)
|
||||||
if product.brand_id:
|
if product.brand_id:
|
||||||
related_stmt = related_stmt.order_by((Product.brand_id == product.brand_id).desc(), Product.created_at.desc())
|
related_stmt = related_stmt.order_by((Product.brand_id == product.brand_id).desc(), Product.created_at.desc())
|
||||||
|
|
@ -1176,7 +1176,7 @@ def get_product_detail_by_slug(slug: str, db: Session = Depends(get_db)):
|
||||||
selectinload(Product.images),
|
selectinload(Product.images),
|
||||||
selectinload(Product.brand),
|
selectinload(Product.brand),
|
||||||
)
|
)
|
||||||
.where(Product.product_id.notin_(existing_ids), Product.is_active == True)
|
.where(Product.product_id.notin_(existing_ids), Product.status == "active")
|
||||||
.order_by(Product.created_at.desc())
|
.order_by(Product.created_at.desc())
|
||||||
.limit(30)
|
.limit(30)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue