diff --git a/app/api/lists/order/OrderList.php b/app/api/lists/order/OrderList.php index 77d7d0eb..26548a45 100644 --- a/app/api/lists/order/OrderList.php +++ b/app/api/lists/order/OrderList.php @@ -60,11 +60,14 @@ class OrderList extends BaseAdminDataLists implements ListsSearchInterface if(empty($find)){ $find = StoreProduct::where('id', $v['product_id'])->withTrashed()->find(); } - $v['store_name'] = $find['store_name']; - $v['image'] = $find['image']; + $v['store_name'] = $find['store_name']??''; + $v['image'] = $find['image']??''; // $v['price'] = $find['price']; $v['price'] = $v['cart_info']['price']; - $v['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name') ?? ''; + $v['unit_name']=''; + if(isset($find['unit']) && $find['unit'] !=''){ + $v['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name') ?? ''; + } }); $item['goods_count'] = count(explode(',', $item['cart_id'])); if ($item['refund_reason_time']) {