base
parent
13f30fbe5d
commit
a797412fd7
|
|
@ -42,11 +42,15 @@ class StoreController extends Controller
|
|||
$input['sort'] = '-id';
|
||||
}
|
||||
|
||||
$spuIds = StoreProductSku::where('store_id', $store->id)->where('status', 1)->pluck('product_spu_id')->toArray();
|
||||
$spuIds = array_unique($spuIds);
|
||||
$spuIds = array_values($spuIds);
|
||||
// $spuIds = StoreProductSku::where('store_id', $store->id)->where('status', 1)->pluck('product_spu_id')->toArray();
|
||||
// $spuIds = array_unique($spuIds);
|
||||
// $spuIds = array_values($spuIds);
|
||||
|
||||
$list = ProductSpu::with(['specs'])->filter($input)->whereIn('id', $spuIds)->simplePaginate(Paginator::resolvePerPage('per_page', 20, 50));
|
||||
$list = $store->productSpus()
|
||||
->with(['specs'])
|
||||
->filter($input)
|
||||
->wherePivot('status', 1)
|
||||
->simplePaginate(Paginator::resolvePerPage('per_page', 20, 50));
|
||||
|
||||
return StoreProductSpuResource::collection($list);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue