This commit is contained in:
shengchanzhe 2023-10-27 21:26:53 +08:00
parent 79d4d3adb9
commit 31b4169b45

View File

@ -2352,7 +2352,7 @@ class ProductRepository extends BaseRepository
$stockIn=1;
}
ProductAttrValue::where('mer_id', $merId)
->where('product_id', $params['product_id'])->where('unique', $params['unique'])
->where('product_id', $params['product_id'])
->update(['stock'=>$attrValue->stock + $stockIn]);
$data = [
'order_id' => $params['order_id'] ?? 0,
@ -2363,7 +2363,7 @@ class ProductRepository extends BaseRepository
'unique' => $attrValue['unique'],
'price' => $price,
'mer_id' => $product->mer_id,
'supplier_mer_id' => $supplierMerId,
'supplier_mer_id' => $orderMerId??0,
];
if (!$model->save($data)) {
throw new \Exception('入库失败', 500);