From 41b2df4a81632165edb4a15f2bca8cd71198a099 Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Fri, 27 Oct 2023 20:49:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/product/ProductRepository.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 1e0966d7..289e4f31 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -2361,6 +2361,9 @@ class ProductRepository extends BaseRepository throw new ValidateException('订单商品不存在'); } if( $orderProduct->is_imported == 1){ + if($stockIn==0){ + $stockIn=1; + } ProductAttrValue::where('mer_id', $merId) ->where('product_id', $params['product_id'])->where('unique', $params['unique']) ->update(['stock'=>$attrValue->stock + $stockIn]);