product detail
This commit is contained in:
parent
c3a431f772
commit
e580fc9953
|
|
@ -84,15 +84,17 @@ class Products extends ProductController
|
||||||
$product = $this->productRepository->select('id','attribute_family_id','type','brand_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'),
|
||||||
'variants' => function($query){
|
'variants' => function($query){
|
||||||
|
$query->whereHas('product_flat', function($qwh){
|
||||||
|
$qwh->where('status',1);
|
||||||
|
});
|
||||||
$query->with(['product_flats' => function($qf){
|
$query->with(['product_flats' => function($qf){
|
||||||
$channel = core()->getRequestedChannelCode();
|
$channel = core()->getRequestedChannelCode();
|
||||||
|
|
||||||
$locale = 'tm';//core()->getRequestedLocaleCode();
|
$locale = 'tm';//core()->getRequestedLocaleCode();
|
||||||
|
|
||||||
$qf->where('product_flat.channel', $channel)
|
$qf->where('product_flat.channel', $channel)
|
||||||
->where('product_flat.locale', $locale)
|
->where('product_flat.locale', $locale);
|
||||||
// ->whereNotNull('product_flat.url_key')
|
|
||||||
->where('product_flat.status',1);
|
|
||||||
}]);
|
}]);
|
||||||
}])->find($id);
|
}])->find($id);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue