From 9de998ec839c9a6594bcf000ab973fc539ea0e40 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 18 Dec 2024 16:00:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=E4=BF=AE=E5=A4=8D=E9=A2=84?= =?UTF-8?q?=E5=94=AE=E8=AE=A2=E5=8D=95=E4=B8=AD=E5=95=86=E5=93=81=E5=B7=B2?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=B6=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在查询商品时使用 withTrashed() 方法,以包含软删除的商品 - 避免在商品被删除后创建预售订单时出现错误 --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 8699bdc60..0d5801906 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -190,9 +190,9 @@ class BeforehandOrderLogic extends BaseLogic $total_prices = $v['total_price']; $v['uid'] = $params['user_id']; $v['store_id'] = $params['store_id']; - $find = StoreBranchProduct::where('store_id', $params['store_id'])->where('product_id', $v['product_id'])->find(); + $find = StoreBranchProduct::where('store_id', $params['store_id'])->where('product_id', $v['product_id'])->withTrashed()->find(); if (!$find) { - $product = StoreProduct::where('id', $v['product_id'])->find(); + $product = StoreProduct::where('id', $v['product_id'])->withTrashed()->find(); $find = StoreProductLogic::ordinary($product, $params['store_id'], 0, $product); }