fix(admin): 修复仓库产品入库价格为零的问题
- 在计算总价时,增加对商品采购价的判断 - 如果采购价小于等于零,则将总价设置为零 - 否则,按照原逻辑计算总价
This commit is contained in:
parent
eb0bcc33c9
commit
03b5c8655d
@ -62,7 +62,11 @@ class WarehouseProductLogic extends BaseLogic
|
||||
if (!$storeProduct) {
|
||||
throw new BusinessException('商品不存在');
|
||||
}
|
||||
$total_price = bcmul($after_nums, $storeProduct['purchase'], 2);
|
||||
if($storeProduct['purchase']<=0){
|
||||
$total_price=0;
|
||||
}else{
|
||||
$total_price = bcmul($after_nums, $storeProduct['purchase'], 2);
|
||||
}
|
||||
$data = [
|
||||
'warehouse_id' => $params['warehouse_id'],
|
||||
'product_id' => $params['product_id'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user