diff --git a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php index 5768adde5..aa1c78a28 100644 --- a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php +++ b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php @@ -82,7 +82,11 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe ->order(['id' => 'desc']) ->select()->each(function ($item) use ($system_store, $order_mark) { $find = StoreProduct::where('id', $item['product_id'])->field('top_cate_id,store_name,image,unit')->withTrashed()->find(); - $item->unit_name = StoreProductUnit::where('id', $find->unit)->value('name'); + if($find->unit>0){ + $item->unit_name = StoreProductUnit::where('id', $find->unit)->value('name'); + }else{ + $item->unit_name = ''; + } $item['warehouse_stock'] = WarehouseProductStorege::where('product_id', $item['product_id'])->where('warehouse_id',1)->value('nums') ?? 0; $item['store_name'] = $find['store_name']; $item['system_store'] = $system_store;