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; //返回处理后的数据。 })