From 5831ea962d18a610192a148d1489a4d4a4a1f0ab Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Fri, 17 Mar 2023 11:30:16 +0800 Subject: [PATCH] Fixed trashed products. --- beike/Admin/Http/Controllers/ProductController.php | 10 ++++++---- beike/Shop/Services/TotalService.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/beike/Admin/Http/Controllers/ProductController.php b/beike/Admin/Http/Controllers/ProductController.php index e2222802..2435c2ee 100644 --- a/beike/Admin/Http/Controllers/ProductController.php +++ b/beike/Admin/Http/Controllers/ProductController.php @@ -45,12 +45,14 @@ class ProductController extends Controller $requestData = $request->all(); $requestData['trashed'] = true; $productList = ProductRepo::list($requestData); - $products = ProductResource::collection($productList)->resource; + $products = ProductResource::collection($productList); + $productsFormat = $products->jsonSerialize(); $data = [ - 'categories' => CategoryRepo::flatten(locale()), - 'products' => $products, - 'type' => 'trashed', + 'categories' => CategoryRepo::flatten(locale()), + 'products_format' => $productsFormat, + 'products' => $products, + 'type' => 'trashed', ]; $data = hook_filter('admin.product.trashed.data', $data); diff --git a/beike/Shop/Services/TotalService.php b/beike/Shop/Services/TotalService.php index 6fec997b..cd98af87 100644 --- a/beike/Shop/Services/TotalService.php +++ b/beike/Shop/Services/TotalService.php @@ -64,7 +64,7 @@ class TotalService { $addressInfo = [ 'shipping_address' => $this->currentCart->shippingAddress ?? $this->currentCart->guest_shipping_address, - 'payment_address' => $this->currentCart->paymentAddress ?? $this->currentCart->guest_payment_address, + 'payment_address' => $this->currentCart->paymentAddress ?? $this->currentCart->guest_payment_address, ]; $taxLib = Tax::getInstance($addressInfo);