From c1d1ccc56db198e5318f29d19c220ed7189dbfcc Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 13 Oct 2024 14:30:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A2=84=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E9=87=87=E8=B4=AD=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本次更新在预订单列表中添加了采购商品状态的提示消息。现在,每个预订单项将显示有多少商品正在采购中,以及是否有商品尚未入库。这将帮助管理员更好地了解每个订单的采购进度和库存状态。 --- .../lists/beforehand_order/BeforehandOrderLists.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index e5121912e..c8c213e8d 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -7,6 +7,7 @@ use app\admin\lists\BaseAdminDataLists; use app\common\model\beforehand_order\BeforehandOrder; use app\common\lists\ListsSearchInterface; use app\common\model\auth\Admin; +use app\common\model\purchase_product_offer\PurchaseProductOffer; /** * 预订单表列表 @@ -43,7 +44,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte public function lists(): array { return BeforehandOrder::where($this->searchWhere) - ->field(['id','order_id', 'uid','order_type','total_num','total_price','outbound_id','admin_id', 'pay_price', 'deduction_price','create_time', 'status', 'mark']) + ->field(['id','order_id', 'uid','order_type','total_num','total_price','outbound_id','admin_id', 'pay_price', 'deduction_price','create_time', 'status', 'mark','warehousing_id']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item){ @@ -63,6 +64,16 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte }elseif($item->order_type==5){ $item->order_type_name='仓库补货'; } + $item->msg=''; + $count1=PurchaseProductOffer::where('order_id',$item->id)->where('buyer_confirm',0)->count('id'); + if($count1>0){ + $item->msg='有'.$count1.'个商品采购中'; + }else{ + $count2=PurchaseProductOffer::where('order_id',$item->id)->where('buyer_confirm',1)->count('id'); + if($count2>0 &&$item['warehousing_id']==0){ + $item->msg='商品没有入库'; + } + } }) ->toArray(); }