From 44310c13518194ad1caaaede0ab03a4d63edca4b Mon Sep 17 00:00:00 2001 From: merdan Date: Mon, 5 Dec 2022 12:46:01 +0500 Subject: [PATCH] order status error fix --- packages/Sarga/API/Http/Controllers/Vendors.php | 2 +- packages/Sarga/API/Http/Resources/Core/Source.php | 6 +++--- packages/Sarga/Shop/src/Models/Order.php | 8 +++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/Sarga/API/Http/Controllers/Vendors.php b/packages/Sarga/API/Http/Controllers/Vendors.php index bdf06fd8c..43d61e1a9 100644 --- a/packages/Sarga/API/Http/Controllers/Vendors.php +++ b/packages/Sarga/API/Http/Controllers/Vendors.php @@ -23,7 +23,7 @@ class Vendors extends V1Controller public function sources(){ $vendors = $this->vendorRepository->select('marketplace_sellers.id','url','shop_title') ->where('is_approved',true) - ->with(['categories:seller_id,type,categories']) +// ->with(['categories:seller_id,type,categories']) // ->leftJoin('seller_categories','marketplace_sellers.id','=','seller_categories.seller_id') ->get(); //return $vendors; diff --git a/packages/Sarga/API/Http/Resources/Core/Source.php b/packages/Sarga/API/Http/Resources/Core/Source.php index 04f7cf5da..00cc7e6ce 100644 --- a/packages/Sarga/API/Http/Resources/Core/Source.php +++ b/packages/Sarga/API/Http/Resources/Core/Source.php @@ -18,9 +18,9 @@ class Source extends \Illuminate\Http\Resources\Json\JsonResource 'id' => $this->id, 'shop_title' => $this->shop_title, 'logo' => $this->logo_url, - $this->mergeWhen(!empty($this->main_categories) && $this->main_categories->count(),[ - 'categories' => VendorCategory::collection($this->main_categories) - ]) +// $this->mergeWhen(!empty($this->main_categories) && $this->main_categories->count(),[ +// 'categories' => VendorCategory::collection($this->main_categories) +// ]) ]; } } \ No newline at end of file diff --git a/packages/Sarga/Shop/src/Models/Order.php b/packages/Sarga/Shop/src/Models/Order.php index f1306dc99..3f1aafd9e 100644 --- a/packages/Sarga/Shop/src/Models/Order.php +++ b/packages/Sarga/Shop/src/Models/Order.php @@ -36,5 +36,11 @@ class Order extends \Webkul\Sales\Models\Order implements \Sarga\Shop\Contracts\ public function canInvoice(): bool{ return $this->status === self::STATUS_SHIPPING && parent::canInvoice(); } - + /** + * Returns the status label from status code + */ + public function getStatusLabelAttribute() + { + return $this->statusLabel[$this->status]; + } } \ No newline at end of file