Add marketplace seller to search repository
This commit is contained in:
parent
aa22a62924
commit
2cfabfc735
|
|
@ -178,7 +178,7 @@ class Products extends ProductController
|
|||
public function searchProducts()
|
||||
{
|
||||
// return $this->productRepository->searchProductByAttribute(request('key'));
|
||||
return ProductResource::collection($this->productRepository->searchProductByAttribute(request('key')));
|
||||
return ProductResource::collection($this->productRepository->searchProductByAttributeDagdan(request('key')));
|
||||
}
|
||||
|
||||
public function discountedProducts()
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class ProductRepository extends WProductRepository
|
|||
return $qb->paginate($limit);
|
||||
}
|
||||
|
||||
public function searchProductByAttributeNurgul($term, $perPage)
|
||||
public function searchProductByAttributeDagdan($term, $perPage)
|
||||
{
|
||||
$channel = core()->getRequestedChannelCode();
|
||||
|
||||
|
|
@ -117,7 +117,11 @@ class ProductRepository extends WProductRepository
|
|||
->addSelect('product_flat.*')
|
||||
->where('product_flat.channel', $channel)
|
||||
->where('product_flat.locale', $locale)
|
||||
->whereNotNull('product_flat.url_key');
|
||||
->whereNotNull('product_flat.url_key')
|
||||
|
||||
->leftJoin('marketplace_products', 'product_flat.product_id', '=', 'marketplace_products.product_id')
|
||||
->leftJoin('marketplace_sellers', 'marketplace_sellers.id', '=', 'marketplace_products.marketplace_seller_id')
|
||||
->addSelect('marketplace_sellers.shop_title');
|
||||
|
||||
if (! core()->getConfigData('catalog.products.homepage.out_of_stock_items')) {
|
||||
$query = $this->checkOutOfStockItem($query);
|
||||
|
|
|
|||
Loading…
Reference in New Issue