From 785b5bd56241d9d0a2a7a774eb942c573931e83c Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 16 Nov 2023 17:04:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= 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 92f0be31..a1074364 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -2358,6 +2358,7 @@ class ProductRepository extends BaseRepository throw new ValidateException('商品规格导入出错'); } } + $product->stock = $stockIn + $product->stock; if ($orderProduct->is_imported == 0) { $attrValue->stock=$attrValue->stock + $stockIn; @@ -2377,6 +2378,8 @@ class ProductRepository extends BaseRepository throw new ValidateException('入库失败'); } $orderProduct->save(['is_imported' => 1]); + $attrValue->save(); + $product->save(); Db::commit(); return true; }else{