From 31aee076c12946a600c1bee0c3f657e18e6c183e Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 16 Oct 2024 18:00:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A2=84=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=94=9F=E6=88=90=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 增加根据预订单ID获取商店名称的功能 - 添加截取预订单标记字符串的逻辑,限制长度为15个字符 - 组合商店名称和预订单标记作为文件名 - 优化后的文件名更具描述性和可读性 --- .../BeforehandOrderCartInfoLists.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php index 9f9afe3cb..e190a791f 100644 --- a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php +++ b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php @@ -10,7 +10,9 @@ use app\common\model\purchase_product_offer\PurchaseProductOffer; use app\common\model\store_product\StoreProduct; use app\common\model\warehouse_product_storege\WarehouseProductStorege; use app\common\lists\ListsExcelInterface; +use app\common\model\beforehand_order\BeforehandOrder; use app\common\model\store_product_unit\StoreProductUnit; +use app\common\model\system_store\SystemStore; /** * 预订单购物详情表列表 @@ -101,7 +103,19 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe */ public function setFileName(): string { - return '预订单商品列表'; + $id=$this->request->get('bhoid'); + $find=BeforehandOrder::where('id',$id)->field('store_id,mark')->find(); + $name=''; + if($find['store_id']>0){ + $name=SystemStore::where('id',$find['store_id'])->value('name'); + } + if($find['mark']!=''){ + $originalString = $find['mark']; + $length = 15; // 截断长度 + $mark = substr($originalString, 0, $length); + $name.='-'.$mark; + } + return $name; }