From 5863d9d113253e915d74f43421863ec1465ba246 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 2 Aug 2024 19:56:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(StoreOrderCartInfoGroupLists,=20StoreOrder?= =?UTF-8?q?CartInfoTwoLists):=20=E4=BC=98=E5=8C=96=E4=BA=86=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=8D=95=E4=BD=8D=E3=80=81=E5=88=86=E7=B1=BB=E5=92=8C?= =?UTF-8?q?=E5=BA=97=E9=93=BA=E5=90=8D=E7=A7=B0=E7=9A=84=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BA=86=E7=A9=BA?= =?UTF-8?q?=E5=80=BC=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StoreOrderCartInfoGroupLists.php | 7 +++++-- .../StoreOrderCartInfoTwoLists.php | 13 ++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php index 4eeeca5b..37153b05 100644 --- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php +++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php @@ -61,12 +61,15 @@ class StoreOrderCartInfoGroupLists extends BaseAdminDataLists implements ListsSe $item['image']=$find['image'];//商品图片 $item['store_name']=$find['store_name'];//商品名称 $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['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name')??""; + $item['cate_name'] = StoreCategory::where('id', $find['cate_id'])->value('name')??""; }else{ $item['image']='';//商品图片 $item['store_name']='';//商品名称 $item['store_info']='';//商品规格-(数据库叫商品简介) + $item['unit_name']='';// + $item['cate_name']='';// + $item['system_store']='';// } return $item; //返回处理后的数据。 }) diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php index 19b9685a..2a8557d5 100644 --- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php +++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php @@ -65,9 +65,16 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear $item['image'] = $find['image']; //商品图片 $item['store_name'] = $find['store_name']; //商品名称 $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['system_store'] = SystemStore::where('id', $item['store_id'])->value('name'); + $item['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name')??''; + $item['cate_name'] = StoreCategory::where('id', $find['cate_id'])->value('name')??''; + $item['system_store'] = SystemStore::where('id', $item['store_id'])->value('name')??''; + }else{ + $item['image']='';//商品图片 + $item['store_name']='';//商品名称 + $item['store_info']='';//商品规格-(数据库叫商品简介) + $item['unit_name']='';// + $item['cate_name']='';// + $item['system_store']='';// } return $item; //返回处理后的数据。 })