From 0cfe4536529ff0f71827de7b38d14061b04f9c93 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 14 Nov 2024 15:40:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(admin):=20=E4=BC=98=E5=8C=96=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E8=A1=A5=E8=B4=A7=E8=AE=A2=E5=8D=95=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在预订单列表中添加"无须出库"标识,方便区分仓库补货订单 - 优化订单处理逻辑,禁止为仓库补货订单创建出库单 - 增加未设置商品提示,提高用户体验 --- .../lists/beforehand_order/BeforehandOrderLists.php | 10 +++++++++- .../logic/beforehand_order/BeforehandOrderLogic.php | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index 4b5db2cb1..0d632cdd8 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -10,6 +10,7 @@ use app\common\model\auth\Admin; use app\common\model\purchase_product_offer\PurchaseProductOffer; use app\common\model\system_store\SystemStore; use app\common\lists\ListsExcelInterface; +use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo; /** * 预订单表列表 @@ -51,6 +52,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item){ + $item['outbound']=''; if($item->admin_id){ $item->admin_name=Admin::where(['id'=>$item->admin_id])->value('name'); }else{ @@ -66,6 +68,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte $item->order_type_name='线上订单'; }elseif($item->order_type==5){ $item->order_type_name='仓库补货'; + $item->outbound='无须出库'; }elseif($item->order_type==6){ $item->order_type_name='往期补单'; } @@ -79,8 +82,13 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte $item->msg='商品没有入库'; } } + if($item->msg==''){ + $count=BeforehandOrderCartInfo::where('is_buyer',0)->count('id'); + if($count>0){ + $item->msg='有'.$count.'个商品未设置'; + } + } $item['warehousing']=''; - $item['outbound']=''; $item['system_store']=''; if($item['warehousing_id']>0){ $item->warehousing='已入库|'.$item['warehousing_id']; diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 9865fa696..4970dee59 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -345,6 +345,9 @@ class BeforehandOrderLogic extends BaseLogic if (!$order) { throw new BusinessException('该订单不存在'); } + if($order['order_type']==5){ + throw new BusinessException('仓库补货,不用出库'); + } if ($order['outbound_id'] > 0) { throw new BusinessException('该订单已创建出库单'); } From 9267218da062815271310bbe594ad386fb011d68 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 14 Nov 2024 15:41:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(admin):=20=E4=BF=AE=E5=A4=8D=E9=A2=84?= =?UTF-8?q?=E5=94=AE=E8=AE=A2=E5=8D=95=E6=9C=AA=E8=AE=BE=E7=BD=AE=E5=95=86?= =?UTF-8?q?=E5=93=81=E6=95=B0=E9=87=8F=E7=9A=84=E6=9F=A5=E8=AF=A2=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在查询未设置商品数量时,增加了对当前订单的筛选条件 - 确保只统计当前订单下的未设置商品,提高了数据准确性 --- app/admin/lists/beforehand_order/BeforehandOrderLists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index 0d632cdd8..048d14830 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -83,7 +83,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte } } if($item->msg==''){ - $count=BeforehandOrderCartInfo::where('is_buyer',0)->count('id'); + $count=BeforehandOrderCartInfo::where('is_buyer',0)->where('bhoid',$item['id'])->count('id'); if($count>0){ $item->msg='有'.$count.'个商品未设置'; }