From d5e9bbec9a0105921ed7fd3361c777af3899407b Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Sat, 8 Feb 2025 14:26:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=88=B0=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 7 +++++-- .../logic/warehouse_product/WarehouseProductLogic.php | 2 +- app/api/logic/order/OrderLogic.php | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 63bdb3a90..b8ee80594 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -263,7 +263,7 @@ class BeforehandOrderLogic extends BaseLogic 'cart_id' => '', 'store_id' => $params['store_id'] ?? 0, 'shipping_type' => 2, //配送方式 1=快递 ,2=门店自提 - 'deduction_price' => 0, //抵扣金额 + 'deduction_price' => $params['deduction_price'] ?? 0, //抵扣金额 'source' => OrderEnum::SOURCE_20, //来源 'order_type' => $order['order_type'], 'is_storage' => 0, @@ -272,9 +272,12 @@ class BeforehandOrderLogic extends BaseLogic if ($_order['pay_price'] == 0) { throw new BusinessException('支付金额不能为0'); } + if ($_order['deduction_price'] > 0) { + $_order['pay_price'] = bcsub($_order['pay_price'], $_order['deduction_price'], 2); + } $_order['uid'] = $uid; $_order['spread_uid'] = 0; - $_order['mark'] = ''; + $_order['mark'] = $params['mark'] ?? ''; $_order['real_name'] = $user['real_name']; $_order['user_phone'] = $user['mobile']; $_order['pay_type'] = $params['pay_type']; diff --git a/app/admin/logic/warehouse_product/WarehouseProductLogic.php b/app/admin/logic/warehouse_product/WarehouseProductLogic.php index 56988889e..76ba8499e 100644 --- a/app/admin/logic/warehouse_product/WarehouseProductLogic.php +++ b/app/admin/logic/warehouse_product/WarehouseProductLogic.php @@ -129,7 +129,7 @@ class WarehouseProductLogic extends BaseLogic if ($params['order_type'] != 6) { $storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find(); if ($storege) { - if (in_array($params['order_type'], [1, 4])) { + if (($params['store_id'] == 3 && in_array($params['order_type'], [1, 2, 3, 4, 8])) || in_array($params['order_type'], [1, 4])) { SystemStoreStorage::create([ 'store_id' => $params['store_id'], 'admin_id' => $params['admin_id'], diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 8735ba11e..c02213566 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -290,6 +290,10 @@ class OrderLogic extends BaseLogic $_order['verify_code'] = $verify_code; $_order['reservation_time'] = null; $_order['reservation'] = 0; + if (isset($params['deduction_price']) && $params['deduction_price'] > 0) { + $_order['deduction_price'] = $params['deduction_price']; + $_order['pay_price'] = bcsub($_order['pay_price'], $_order['deduction_price'], 2); + } if ($uid > 0) { $address = UserAddress::where(['uid' => $uid])->find(); From 5eeffb91d302b2e8c5667e004bafef6f65140bf3 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Sat, 8 Feb 2025 15:37:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=88=B0=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 3 +++ .../purchase_product_offer/PurchaseProductOfferLogic.php | 6 +++--- app/api/logic/order/OrderLogic.php | 3 +++ app/common/logic/PayNotifyLogic.php | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index b8ee80594..9448650a4 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -274,6 +274,9 @@ class BeforehandOrderLogic extends BaseLogic } if ($_order['deduction_price'] > 0) { $_order['pay_price'] = bcsub($_order['pay_price'], $_order['deduction_price'], 2); + if ($_order['pay_price'] < 0.01) { + throw new BusinessException('支付金额不能小于0.01元'); + } } $_order['uid'] = $uid; $_order['spread_uid'] = 0; diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index ca9e9a33a..a0f790afb 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -515,7 +515,7 @@ class PurchaseProductOfferLogic extends BaseLogic 'unit' => $product['unit'], 'cart_num' => $product['nums'], 'accept_num' => $product['nums'], - 'mark' => $product['mark'], + 'mark' => $product['mark'] ?? '', 'is_buyer' => 1, 'procurement_order_id' => $procurementOrder['id'], 'total_price' => bcmul($product['price'], $product['nums'], 2), @@ -533,7 +533,7 @@ class PurchaseProductOfferLogic extends BaseLogic 'unit' => $product['unit'], 'is_buyer' => 1, 'need_num' => $product['nums'], - 'mark' => $product['mark'], + 'mark' => $product['mark'] ?? '', 'buyer_id' => $params['buyer_id'], 'status' => 0, 'source_order_info' => [ @@ -541,7 +541,7 @@ class PurchaseProductOfferLogic extends BaseLogic 'source_order_id' => $procurementOrder['id'], 'product_id' => $product['product_id'], 'need_num' => $product['nums'], - 'mark' => $product['mark'], + 'mark' => $product['mark'] ?? '', ] ] ]; diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index c02213566..89be6ee27 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -293,6 +293,9 @@ class OrderLogic extends BaseLogic if (isset($params['deduction_price']) && $params['deduction_price'] > 0) { $_order['deduction_price'] = $params['deduction_price']; $_order['pay_price'] = bcsub($_order['pay_price'], $_order['deduction_price'], 2); + if ($_order['pay_price'] < 0.01) { + throw new BusinessException('支付金额不能小于0.01元'); + } } if ($uid > 0) { diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index e560ac23f..58069b0ed 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -630,7 +630,7 @@ class PayNotifyLogic extends BaseLogic continue; } } - if ($order['source'] != OrderEnum::SOURCE_20) { + if ($order['source'] != OrderEnum::SOURCE_20 || $order['store_id'] == 3) { if ($branchProduct) { $stock = bcsub($branchProduct['stock'], $v['cart_num'], 2); StoreBranchProduct::update([ From c14d3b8d47448ff82b168509e5d572c7749768fd Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 8 Feb 2025 15:44:23 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat(admin):=20=E4=BC=98=E5=8C=96=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E4=BA=A7=E5=93=81=E5=88=97=E8=A1=A8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将搜索字段从 'product_id' 改为 'product_name',以支持通过产品名称搜索 - 更新搜索逻辑,使用产品名称模糊匹配来获取产品 ID 列表 - 调整搜索条件,支持通过产品名称进行精确搜索 --- .../lists/warehouse_product/WarehouseProductLists.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/admin/lists/warehouse_product/WarehouseProductLists.php b/app/admin/lists/warehouse_product/WarehouseProductLists.php index ec0fe5d90..20c42fcbd 100644 --- a/app/admin/lists/warehouse_product/WarehouseProductLists.php +++ b/app/admin/lists/warehouse_product/WarehouseProductLists.php @@ -35,7 +35,7 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt public function setSearch(): array { return [ - '=' => ['warehouse_id', 'financial_pm', 'store_id','oid','supplier_id','is_pay','code'], + '=' => ['warehouse_id', 'financial_pm', 'product_id','store_id','oid','supplier_id','is_pay','code'], 'between_time' => 'create_time' ]; } @@ -52,9 +52,9 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt */ public function lists(): array { - if ($this->request->get('product_id')) { - $product_id = $this->request->get('product_id'); - $ids = StoreProduct::where('store_name', 'like', '%' . $product_id . '%')->withTrashed()->column('id'); + if ($this->request->get('product_name')) { + $product_name = $this->request->get('product_name'); + $ids = StoreProduct::where('store_name', 'like', '%' . $product_name . '%')->withTrashed()->column('id'); if ($ids) { $this->searchWhere[] = ['product_id', 'in', $ids]; $this->ids = $ids; From 51e848718fa489bc810b04fc94d4d8df21944864 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Sat, 8 Feb 2025 16:17:21 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=88=B0=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 9448650a4..a92fd5264 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -619,8 +619,8 @@ class BeforehandOrderLogic extends BaseLogic 'paid' => 0, 'audit_status' => 1, 'mark' => $params['mark'] ?? '', - 'other_data' => json_encode($other_data, true) - + 'other_data' => json_encode($other_data, true), + 'is_arrears' => 2 ]); foreach ($datas as $k => $v) { $datas[$k]['bhoid'] = $order['id'];