From 2506a02601a4a090a6b960e33de6af75e69f076c Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 18 Oct 2024 13:00:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor(admin):=20=E4=BC=98=E5=8C=96=E9=A2=84?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=9B=B4=E6=96=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将订单更新方法从 update 改为 save,提高代码可读性 - 在捕获异常时添加调试信息输出,便于问题排查 --- .../BeforehandOrderCartInfoLogic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index b9f27d13b..95719e1ca 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -117,7 +117,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic PurchaseProductOffer::where('order_id',$bhoid)->where('product_id',$find['product_id'])->update(['need_num'=>$params['nums']]); } $order=BeforehandOrder::where('id', $bhoid)->find(); - $order->update(['total_price' => $info['total_price'], 'total_num' => $info['cart_num']]); + $order->save(['total_price' => $info['total_price'], 'total_num' => $info['cart_num']]); if($order['outbound_id']>0){ $wp= WarehouseProduct::where('oid',$order['outbound_id'])->where('product_id',$find['product_id'])->where('financial_pm',0)->find(); @@ -131,6 +131,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic return true; } catch (\Throwable $e) { Db::rollback(); + d($e); throw new BusinessException($e->getMessage()); } }