feat: 添加了商品信息空值处理

This commit is contained in:
mkm 2024-09-06 14:12:56 +08:00
parent 2cbe0fc8a3
commit 1dca91528d

View File

@ -106,6 +106,8 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt
}
} else {
$item->store_name = '';
$item->image = '';
$item->price = '';
}
if ($item->warehouse_id) {
$item->warehouse_name = Warehouse::where('id', $item->warehouse_id)->value('name');
@ -114,6 +116,8 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt
}
if ($item->supplier_id) {
$item->supplier_name = Supplier::where('id', $item->supplier_id)->value('mer_name');
}else{
$item->supplier_name = '';
}
$item->expiration_date = $item->expiration_date ? date('Y-m-d', $item->expiration_date) : '';
$item->manufacture = $item->manufacture ? date('Y-m-d', $item->manufacture) : '';