api seller

This commit is contained in:
Kerim 2023-08-26 11:24:59 +05:00
parent 9965d068de
commit 236fe95825
2 changed files with 4 additions and 3 deletions

View File

@ -54,7 +54,8 @@ class Product extends JsonResource
//'logo' => $this->logo ? Storage::url($this->logo) : null,
'new' => $this->new,
'featured' => $this->featured,
'qty' => $product->qty,
'qty' => $this->qty,
'status' => $this->status,
// 'brand' => $product->brand->name ?? '',

View File

@ -520,8 +520,8 @@ class ProductRepository extends WProductRepository
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('product_inventories', 'products.id', '=', 'product_inventories.product_id')
->addSelect('product_inventories.qty')
->leftJoin('marketplace_products', 'product_flat.product_id', '=', 'marketplace_products.product_id')
->where('product_flat.channel', $channel)
->where('product_flat.locale', $locale)