From bdc290c6b180eca94ce9be8bf899539ab7e51f43 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GMUNQ1B\\Administrator" <604446095@qq.com> Date: Wed, 18 Dec 2024 17:46:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=9B=9E=E6=BB=9A=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/beforehand_order/BeforehandOrderLogic.php | 2 +- .../PurchaseProductOfferLogic.php | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 0d5801906..3f13d8eec 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -678,7 +678,7 @@ class BeforehandOrderLogic extends BaseLogic { $order_info = new OrderInfo(); $order = BeforehandOrder::where('id', $params['id'])->find(); - if ($order['order_type'] == 7 && $params['print'] == 1) { + if ($order['order_type'] == 7 && isset($params['print']) && $params['print'] == 1) { $order->is_buying = 1; $order->save(); } diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index 7ca280fb6..ad3c317c1 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -41,23 +41,13 @@ class PurchaseProductOfferLogic extends BaseLogic { Db::startTrans(); try { - $procurementOrder = BeforehandOrder::where('order_type', 7)->where('is_buying', 0)->find(); - if (empty($procurementOrder)) { - $beforeOrder = BeforehandOrder::where('id', $params['order_id'])->findOrEmpty()->toArray(); - unset($beforeOrder['id'], $beforeOrder['create_time'], $beforeOrder['update_time']); - $procurementOrder = new BeforehandOrder(); - $procurementOrder->setAttrs($beforeOrder); - $procurementOrder->order_id = getNewOrderId('CG'); - $procurementOrder->order_type = 7; - $procurementOrder->save(); - } $mark = $params['mark'] ?? ''; if ($mark == '') { $mark = BeforehandOrderCartInfo::where('bhoid', $params['order_id'])->where('product_id', $params['product_id'])->value('mark'); } $find=StoreProduct::where('id',$params['product_id'])->find(); PurchaseProductOffer::create([ - 'order_id' => $procurementOrder['id'], + 'order_id' => $params['order_id'], 'product_id' => $params['product_id'], 'unit' => $params['unit'], 'is_buyer' => $params['is_buyer'],