From 22ba0f70db011301e4c538543263e7ee7522d808 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Thu, 6 Mar 2025 11:20:04 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=BD=95=E5=85=A5=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase_product_offer/PurchaseProductOfferLogic.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index 3e4c0ee5..0433816d 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -498,6 +498,8 @@ class PurchaseProductOfferLogic extends BaseLogic $purchaseOffer = []; $cartInfo = []; foreach ($params['product_arr'] as $product) { + $product['price'] = trim($product['price']); + $product['nums'] = trim($product['nums']); if ($product['product_id'] <= 0) { continue; } @@ -542,7 +544,7 @@ class PurchaseProductOfferLogic extends BaseLogic BeforehandOrderCartInfo::insertAll($cartInfo); Db::commit(); return true; - } catch (\Exception $e) { + } catch (\Throwable $e) { Db::rollback(); throw new BusinessException($e->getMessage()); } From a00173be2ebab383fb03653c9183255137ee31ca Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Thu, 6 Mar 2025 16:16:06 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=BD=95=E5=85=A5=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 2 ++ .../purchase_product_offer/PurchaseProductOfferLogic.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index b421c5ca..fc89ae7a 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -89,6 +89,8 @@ class BeforehandOrderLogic extends BaseLogic unset($params['product_arr'][$k]); continue; } + $v['price'] = trim($v['price']); + $v['nums'] = trim($v['nums']); $total_prices = bcmul($v['price'], $v['nums'], 2); $datas[$k]['purchase'] = $v['purchase']; $datas[$k]['mark'] = $v['mark'] ?? ''; diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index 0433816d..e5f83859 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -498,11 +498,11 @@ class PurchaseProductOfferLogic extends BaseLogic $purchaseOffer = []; $cartInfo = []; foreach ($params['product_arr'] as $product) { - $product['price'] = trim($product['price']); - $product['nums'] = trim($product['nums']); if ($product['product_id'] <= 0) { continue; } + $product['price'] = trim($product['price']); + $product['nums'] = trim($product['nums']); $cartInfo[] = [ 'bhoid' => $procurementOrder['id'], 'product_id' => $product['product_id'], From 703356cc3cf0a92567d91b167826a4c0f4d810d8 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Thu, 6 Mar 2025 17:01:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/lists/store_product/StoreProductLists.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/lists/store_product/StoreProductLists.php b/app/admin/lists/store_product/StoreProductLists.php index d1201c4c..de7a7cdb 100644 --- a/app/admin/lists/store_product/StoreProductLists.php +++ b/app/admin/lists/store_product/StoreProductLists.php @@ -138,9 +138,9 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa $category = StoreCategory::where('id', 'in', [$item['top_cate_id'], $item['two_cate_id'], $item['cate_id']])->column('name'); $item['cate_name'] = implode('/', $category); if ($is_warehouse == 1) { - $item['stock'] = WarehouseProductStorege::where('product_id', $item['id'])->sum('nums'); + $item['stock'] = WarehouseProductStorege::where('product_id', $item['id'])->where('warehouse_id', 1)->sum('nums'); } else { - $nums = WarehouseProductStorege::where('product_id', $item['id'])->sum('nums'); + $nums = WarehouseProductStorege::where('product_id', $item['id'])->where('warehouse_id', 1)->sum('nums'); $item['stock'] = bcadd($nums, $stock); } if ($userShip == 4) {