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'],