From a49919882a0ab51f6cd14690e6982bea9eb4d648 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Fri, 14 Mar 2025 18:16:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=95=86=E5=93=81=E6=BA=AF?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/product_source_link/ProductSourceLinkLogic.php | 1 + .../WarehouseProductReturnLogic.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/admin/logic/product_source_link/ProductSourceLinkLogic.php b/app/admin/logic/product_source_link/ProductSourceLinkLogic.php index ca4c02d7a..c80b9f355 100644 --- a/app/admin/logic/product_source_link/ProductSourceLinkLogic.php +++ b/app/admin/logic/product_source_link/ProductSourceLinkLogic.php @@ -268,6 +268,7 @@ class ProductSourceLinkLogic extends BaseLogic if ($inventoryTransfer['two_type'] == 1) { $info['store_id'] = $inventoryTransfer['two_id']; } else { + $info['store_id'] = $inventoryTransfer['one_id']; $info['warehouse_id'] = $inventoryTransfer['two_id']; } $list = $query->where('current_nums', '>', 0) diff --git a/app/admin/logic/warehouse_product_return/WarehouseProductReturnLogic.php b/app/admin/logic/warehouse_product_return/WarehouseProductReturnLogic.php index 9f71ac569..7f4edb2d1 100644 --- a/app/admin/logic/warehouse_product_return/WarehouseProductReturnLogic.php +++ b/app/admin/logic/warehouse_product_return/WarehouseProductReturnLogic.php @@ -99,9 +99,10 @@ class WarehouseProductReturnLogic extends BaseLogic WarehouseProductReturn::create($datas); - $updateNums = bcsub($params['nums'], $find['nums'],2); - if ($updateNums != 0) { - WarehouseProductLogic::updateProductSourceLink($find, $params, $updateNums); + $updateNums = bcsub($find['nums'], $params['nums'], 2); + if ($params['nums'] != 0) { + $numTemp = bcsub($find['nums'], $params['nums'], 2); + WarehouseProductLogic::updateProductSourceLink($find, array_merge($params, ['nums' => $numTemp]), $updateNums); } if ($params['financial_pm'] == 1 && $params['return_type'] == 1) {