From bb0bc0c29a15bc36d17b9f578a91087f4b68e930 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 14 Oct 2024 14:51:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E5=90=8D=E7=A7=B0=E5=92=8C=E5=AF=BC=E5=87=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96=E9=87=87=E8=B4=AD=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E5=8D=95=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在预订单购物详情表中添加商品单位名称字段 - 实现预订单商品列表的导出功能 - 在采购报价单列表中添加顶级分类名称字段 --- .../BeforehandOrderCartInfoLists.php | 35 ++++++++++++++++++- .../PurchaseProductOfferLists.php | 1 + 2 files changed, 35 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 29e254235..90513d2ac 100644 --- a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php +++ b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php @@ -9,13 +9,15 @@ use app\common\lists\ListsSearchInterface; 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\store_product_unit\StoreProductUnit; /** * 预订单购物详情表列表 * Class BeforehandOrderCartInfoLists * @package app\admin\listsbeforehand_order_cart_info */ -class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSearchInterface +class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface { @@ -50,6 +52,7 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe ->order(['id' => 'desc']) ->select()->each(function($item){ $find=StoreProduct::where('id',$item['product_id'])->field('store_name,image,unit')->withTrashed()->find(); + $item->unit_name=StoreProductUnit::where('id',$find->unit)->value('name'); $item['warehouse_stock']=WarehouseProductStorege::where('product_id',$item['product_id'])->value('nums')??0; $item['store_name']=$find['store_name']; $item['image']=$find['image']; @@ -79,4 +82,34 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe return BeforehandOrderCartInfo::where($this->searchWhere)->count(); } + /** + * @notes 导出文件名 + * @return string + * @author 乔峰 + * @date 2022/11/24 16:17 + */ + public function setFileName(): string + { + return '预订单商品列表'; + } + + + /** + * @notes 导出字段 + * @return string[] + * @author 乔峰 + * @date 2022/11/24 16:17 + */ + public function setExcelFields(): array + { + $data=[ + 'store_name' => '商品名称', + 'warehouse_stock' => '仓库数量', + 'cart_num' => '需求数量', + 'unit_name' => '单位', + 'price' => '单价', + 'total_price' => '总价', + ]; + return $data; + } } \ No newline at end of file diff --git a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php index 1bbb9e654..f292d17ee 100644 --- a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -58,6 +58,7 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc $item->image=$find->image; $item->unit_name=StoreProductUnit::where('id',$item->unit)->value('name'); $item->cate_name=StoreCategory::where('id',$find->cate_id)->value('name'); + $item->top_cate_name=StoreCategory::where('id',$find->top_cate_id)->value('name'); if($item->is_buyer==1){ $item->is_buyer_name='需要采购'; }elseif($item->is_buyer==-1){