From 62b5044d331e9e76b93b5fa48ff344f6a34b5c97 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 16 Nov 2023 15:42:39 +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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 84659ffe..4193dc27 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -2355,10 +2355,8 @@ class ProductRepository extends BaseRepository } if ($orderProduct->is_imported == 0) { $stockIn=$orderProduct['product_num']; - - ProductAttrValue::where('mer_id', $merId) - ->where('product_id', $product['product_id']) - ->update(['stock' => $attrValue->stock + $stockIn]); + $attrValue->update(['stock' => $attrValue->stock + $stockIn]); + $product->stock = $stockIn + $product->stock; $data = [ 'order_id' => $params['order_id'] ?? 0, 'order_product_id' => $params['order_product_id'] ?? 0,