修改商品入库数量的错误
This commit is contained in:
parent
7806011ad5
commit
de148080fd
@ -2311,7 +2311,9 @@ class ProductRepository extends BaseRepository
|
||||
$price = $orderProduct['product_price'] ?? 0;
|
||||
$supplierMerId = $orderMerId ?? 0;
|
||||
}
|
||||
if ($stockIn > 0) {
|
||||
if ($stockIn <= 0) {
|
||||
throw new \Exception('入库数量不能小于等于0');
|
||||
}
|
||||
$attrValue->stock = $attrValue->stock + $stockIn;
|
||||
$attrValue->save();
|
||||
$product->stock = $stockIn + $product->stock;
|
||||
@ -2336,7 +2338,6 @@ class ProductRepository extends BaseRepository
|
||||
if (isset($orderProduct) && !$orderProduct->save(['is_imported' => 1])) {
|
||||
throw new \Exception('订单商品更新出错');
|
||||
}
|
||||
}
|
||||
Db::commit();
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
|
@ -29,7 +29,8 @@ class MerchantUpdateValidate extends Validate
|
||||
'mer_address|店铺地址' => 'require|max:128',
|
||||
'long|店铺经度' => 'max:24',
|
||||
'lat|店铺纬度' => 'max:24',
|
||||
'interest_rate|利率' => 'max:0.05',
|
||||
'interest_rate|利率' => 'min:0.01|max:0.1',
|
||||
'settle_cycle|结算周期' => 'min:15|max:90',
|
||||
];
|
||||
|
||||
protected function isPhone($val)
|
||||
|
Loading…
x
Reference in New Issue
Block a user