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]);