api seller
This commit is contained in:
parent
cf4750933a
commit
aa8f8f9f8c
|
|
@ -519,17 +519,15 @@ class ProductRepository extends WProductRepository
|
|||
->addSelect(DB::raw('IF( product_flat.special_price_from IS NOT NULL
|
||||
AND product_flat.special_price_to IS NOT NULL , IF( NOW( ) >= product_flat.special_price_from
|
||||
AND NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , IF( product_flat.special_price_from IS NULL , IF( product_flat.special_price_to IS NULL , IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , IF( NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) ) , IF( product_flat.special_price_to IS NULL , IF( NOW( ) >= product_flat.special_price_from, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , product_flat.price ) ) ) AS price1'))
|
||||
|
||||
->leftJoin('products', 'product_flat.product_id', '=', 'products.id')
|
||||
// ->leftJoin('product_inventories', 'product_flat.product_id', '=', 'product_inventories.product_id')
|
||||
// ->addSelect()
|
||||
->leftJoin('marketplace_products', 'product_flat.product_id', '=', 'marketplace_products.product_id')
|
||||
->where('product_flat.visible_individually', 1)
|
||||
->where('product_flat.status', 1)
|
||||
->where('product_flat.channel', $channel)
|
||||
->where('product_flat.locale', $locale)
|
||||
->whereNotNull('product_flat.url_key')
|
||||
->where('marketplace_products.marketplace_seller_id', $seller_id);
|
||||
// ->where('marketplace_products.is_approved', 1);
|
||||
|
||||
|
||||
$qb->addSelect(DB::raw('(CASE WHEN marketplace_products.is_owner = 0 THEN marketplace_products.price ELSE product_flat.price END) AS price2'));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue