product detail

This commit is contained in:
merdan 2023-05-04 13:21:31 +05:00
parent e0330b7b0f
commit bbfacd0934
1 changed files with 8 additions and 1 deletions

View File

@ -60,8 +60,15 @@ class Products extends ProductController
public function product($id){
$product = $this->productRepository->select('id','attribute_family_id','type','brand_id')
->with(['brand','related_products'=> fn($rp) => $rp->select('id','type','attribute_family_id','brand_id')->with('brand'),
->with(['brand','related_products'=> fn($rp) => $rp->select('id','type','attribute_family_id','brand_id')
->with('brand')
->whereHas('product_flat', function($qwh){
$qwh->where('status',1);
}),
'variants' => function($query){
$query->whereHas('product_flat', function($qwh){
$qwh->where('status',1);
});
$query->with(['product_flats' => function($qf){
$channel = core()->getRequestedChannelCode();