前台只显示启用商品

This commit is contained in:
Edward Yang 2022-08-19 20:36:01 +08:00
parent 3002721a48
commit 728c5a7671
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ class ProductRepo
*/
public static function getProductsByCategory($categoryId): AnonymousResourceCollection
{
$builder = self::getBuilder(['category_id' => $categoryId]);
$builder = self::getBuilder(['category_id' => $categoryId, 'active' => 1]);
$products = $builder->with('inCurrentWishlist')->get();
return ProductSimple::collection($products);
}