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,