更新
This commit is contained in:
parent
dac2051f3d
commit
79109e7f04
@ -2370,8 +2370,8 @@ class ProductRepository extends BaseRepository
|
|||||||
if ($stockIn <= 0) {
|
if ($stockIn <= 0) {
|
||||||
throw new ValidateException('入库数量不能小于等于0');
|
throw new ValidateException('入库数量不能小于等于0');
|
||||||
}
|
}
|
||||||
$attrValue->stock = $attrValue->stock + $stockIn;
|
ProductAttrValue::where('mer_id', $merId)->where('product_id', $product['product_id'])->where('sku', $sku)->update(['stock'=>$attrValue->stock + $stockIn]);
|
||||||
$attrValue->save();
|
|
||||||
$product->stock = $stockIn + $product->stock;
|
$product->stock = $stockIn + $product->stock;
|
||||||
if (!$product->save()) {
|
if (!$product->save()) {
|
||||||
throw new \Exception('商品库存保存失败', 500);
|
throw new \Exception('商品库存保存失败', 500);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user