mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 06:30:49 +00:00
feat:
This commit is contained in:
parent
72ffbbc40d
commit
f95516e182
@ -46,9 +46,10 @@ abstract class BusinessClient
|
|||||||
$item['shop_id'] = $shopId;
|
$item['shop_id'] = $shopId;
|
||||||
$orderItem = BusinessOrderItem::firstOrNew(['shop_id' => $shopId, 'business_order_id' => $orderRecord->id, 'goods_id' => $item['goods_id'], 'sku_id' => $item['sku_id']], $item);
|
$orderItem = BusinessOrderItem::firstOrNew(['shop_id' => $shopId, 'business_order_id' => $orderRecord->id, 'goods_id' => $item['goods_id'], 'sku_id' => $item['sku_id']], $item);
|
||||||
$num = 0;
|
$num = 0;
|
||||||
|
$cancelNum = $item['already_cancel_number'] ?? 0;
|
||||||
if (empty($orderItem->id)) {
|
if (empty($orderItem->id)) {
|
||||||
if ($item['cancel_status']) {
|
if ($item['cancel_status']) {
|
||||||
if ($num = $item['goods_number'] - $item['already_cancel_number']) {
|
if ($num = $item['goods_number'] - $cancelNum) {
|
||||||
// 扣库存 $reduceNum
|
// 扣库存 $reduceNum
|
||||||
$num = 0 - $num;
|
$num = 0 - $num;
|
||||||
}
|
}
|
||||||
@ -61,7 +62,7 @@ abstract class BusinessClient
|
|||||||
if ($item['cancel_status'] !== $orderItem->cancel_status) {
|
if ($item['cancel_status'] !== $orderItem->cancel_status) {
|
||||||
if ($item['cancel_status']) {
|
if ($item['cancel_status']) {
|
||||||
// 加库存
|
// 加库存
|
||||||
$num = $item['already_cancel_number'];
|
$num = $cancelNum;
|
||||||
} else {
|
} else {
|
||||||
// 扣库存
|
// 扣库存
|
||||||
$num = 0 - $item['goods_number'];
|
$num = 0 - $item['goods_number'];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user