From 5e5cc45490957b6d8193189025e0f07fdd604a92 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Sat, 15 Jun 2024 11:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=B7=B2=E7=BB=8F=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=9A=84=E5=88=9B=E5=BB=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 1f422b03d..4e4177fe6 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -71,7 +71,7 @@ class OrderLogic extends BaseLogic /** 计算价格 */ foreach ($cart_select as $k => $v) { - $find = StoreBranchProduct::where(['product_id' => $v['product_id'], 'store_id' => $params['store_id']])->field('id branch_product_id,store_name,image,unit,price,vip_price,cost,product_id')->find(); + $find = StoreBranchProduct::where(['product_id' => $v['product_id'], 'store_id' => $params['store_id']])->field('id branch_product_id,store_name,image,unit,price,vip_price,cost,product_id')->withTrashed()->find(); if (!$find) { continue; } @@ -200,7 +200,7 @@ class OrderLogic extends BaseLogic $goods_list[$k]['uid'] = request()->userId; $goods_list[$k]['cart_id'] = implode(',', $cartId); $goods_list[$k]['delivery_id'] = $params['store_id']; //商家id - $StoreBranchProduct = StoreBranchProduct::where('id',$v['branch_product_id'])->find(); + $StoreBranchProduct = StoreBranchProduct::where('id',$v['branch_product_id'])->withTrashed()->find(); $updateData[] = [ 'id' => $v['branch_product_id'], 'stock' => $StoreBranchProduct['stock']-$v['cart_num'],