From 08615d130c1d003b4c334449568e1c6bf5ffdd1b Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 15 Oct 2024 15:40:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E9=94=AE=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=8A=9F=E8=83=BD=E7=9A=84=E9=80=BB=E8=BE=91=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改BeforehandOrderLogic中的注释,将"一键入库"更改为"一键出库" - 更新BeforehandOrderCartInfoLogic中的入库逻辑,增加订单类型字段 - 优化重复入库的判断条件,提高代码可读性和性能 --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 2 +- .../BeforehandOrderCartInfoLogic.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index d5adddd36..cbae51f2f 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -277,7 +277,7 @@ class BeforehandOrderLogic extends BaseLogic } /** - * @notes 一键入库 + * @notes 一键出库 * @param array $params * @return bool * @author admin diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index 8ef7314e9..bdaebeedf 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -125,9 +125,9 @@ class BeforehandOrderCartInfoLogic extends BaseLogic throw new BusinessException('参数错误'); } $count = PurchaseProductOffer::where(['order_id' => $params['bhoid'], 'is_storage' => 0, 'buyer_nums' => 0])->count('id'); - $warehousing_id = BeforehandOrder::where('id', $params['bhoid'])->value('warehousing_id'); + $beforehandOrder = BeforehandOrder::where('id', $params['bhoid'])->field('order_type,warehousing_id')->find(); - if ($count > 0 || $warehousing_id > 0) { + if ($count > 0 || $beforehandOrder['warehousing_id'] > 0) { throw new BusinessException('请勿重复入库'); } $offer_list = PurchaseProductOffer::where(['order_id' => $params['bhoid'], 'is_storage' => 0])->select(); @@ -152,6 +152,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic $res = WarehouseOrder::create($arr); foreach ($offer_list as $k => $v) { $data['admin_id'] = $params['admin_id']; + $data['order_type'] = $beforehandOrder['order_type']; $data['store_id'] = 0; $data['oid'] = $res['id']; $data['supplier_id'] = $v['supplier_id'];