修复品牌页翻页问题
This commit is contained in:
parent
683145f45a
commit
8cddc5fa5a
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -7,10 +7,13 @@
|
|||
<x-shop-breadcrumb type="brand" :value="$brand" />
|
||||
|
||||
<div class="row">
|
||||
@foreach ($products as $product)
|
||||
@foreach ($products_format as $product)
|
||||
<div class="col-6 col-md-3">@include('shared.product')</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
{{ $products->links('shared/pagination/bootstrap-4') }}
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
|
|
|||
Loading…
Reference in New Issue