From 7af7906e01592f59b832d76a9c1c0ce1f4d5d842 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 7 Nov 2024 16:19:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E6=B7=BB=E5=8A=A0=E5=95=86?= =?UTF-8?q?=E5=93=81=E9=A1=B6=E7=BA=A7=E5=88=86=E7=B1=BB=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 StoreOrderCartInfoTwoLists 类中添加商品顶级分类信息 - 在查询商品信息时,增加 top_cate_id 字段的获取 - 在结果集中添加 top_cate_name 字段,用于显示商品的顶级分类名称 --- .../store_order_cart_info/StoreOrderCartInfoTwoLists.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php index 12aaad7e3..d8e5967fc 100644 --- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php +++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php @@ -76,7 +76,7 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear } return $query->limit($this->limitOffset, $this->limitLength) ->select()->each(function ($item) use($is_group,$export){ - $find = StoreProduct::where('id', $item['product_id'])->field('image,unit,cate_id,store_name,store_info')->withTrashed()->find(); + $find = StoreProduct::where('id', $item['product_id'])->field('image,unit,top_cate_id,cate_id,store_name,store_info')->withTrashed()->find(); $item['nickname']=''; $item['mobile']=''; $item['order_id']=''; @@ -104,6 +104,7 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear $item['store_info'] = $find['store_info']; //商品规格 $item['unit_name'] = StoreProductUnit::where('id', $find['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') ?? ''; $item['system_store'] = SystemStore::where('id', $item['store_id'])->value('name') ?? ''; } else { $item['image'] = ''; //商品图片 @@ -160,6 +161,7 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear 'store_name' => '商品名称', 'store_info' => '规格', 'unit_name' => '单位', + 'top_cate_name' => '顶级分类', 'cate_name' => '分类', 'cart_num' => '数量', 'price' => '单价', @@ -172,6 +174,7 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear 'store_name' => '商品名称', 'store_info' => '规格', 'unit_name' => '单位', + 'top_cate_name' => '顶级分类', 'cate_name' => '分类', 'cart_num' => '数量', 'price' => '单价',