更新默认值

This commit is contained in:
shengchanzhe 2023-10-27 20:49:08 +08:00
parent 6d7edcd628
commit 41b2df4a81

View File

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