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{