diff --git a/beike/Repositories/ProductRepo.php b/beike/Repositories/ProductRepo.php index 2520cb46..e5173cbc 100644 --- a/beike/Repositories/ProductRepo.php +++ b/beike/Repositories/ProductRepo.php @@ -48,7 +48,7 @@ class ProductRepo public static function getProductsByCategory($categoryId): AnonymousResourceCollection { $builder = self::getBuilder(['category_id' => $categoryId, 'active' => 1]); - $products = $builder->with('inCurrentWishlist')->paginate(); + $products = $builder->with('inCurrentWishlist')->paginate(20); return ProductSimple::collection($products); } diff --git a/beike/Shop/Http/Controllers/BrandController.php b/beike/Shop/Http/Controllers/BrandController.php index d115224e..b3b781a1 100644 --- a/beike/Shop/Http/Controllers/BrandController.php +++ b/beike/Shop/Http/Controllers/BrandController.php @@ -31,7 +31,8 @@ class BrandController extends Controller $data = [ 'brand' => $brand, - 'products' => ProductSimple::collection($products)->jsonSerialize(), + 'products' => $products, + 'products_format' => ProductSimple::collection($products)->jsonSerialize(), ]; return view('brand/info', $data); diff --git a/themes/default/brand/info.blade.php b/themes/default/brand/info.blade.php index 1dc59468..be7e7685 100644 --- a/themes/default/brand/info.blade.php +++ b/themes/default/brand/info.blade.php @@ -7,10 +7,13 @@
- @foreach ($products as $product) + @foreach ($products_format as $product)
@include('shared.product')
@endforeach
+ + {{ $products->links('shared/pagination/bootstrap-4') }} + @endsection