diff --git a/app/admin/controller/warehouse_order/WarehouseOrderController.php b/app/admin/controller/warehouse_order/WarehouseOrderController.php index 190a18e3f..122672579 100644 --- a/app/admin/controller/warehouse_order/WarehouseOrderController.php +++ b/app/admin/controller/warehouse_order/WarehouseOrderController.php @@ -203,7 +203,7 @@ class WarehouseOrderController extends BaseAdminController $credit_pay = 0; $cash_pay = 0; foreach ($data as $key => &$value) { - $find = StoreProduct::where('id', $value->product_id)->find(); + $find = StoreProduct::where('id', $value->product_id)->withTrashed()->find(); $value->store_name = $find['store_name'] ?? ''; $value->store_info = $find['store_info'] ?? ''; if (!empty($find['unit'])) { @@ -248,9 +248,9 @@ class WarehouseOrderController extends BaseAdminController $total_price=0; foreach ($data as $key => &$value) { if(in_array($order['store_id'],[17,18])){ - $find = StoreBranchProduct::where('product_id', $value->product_id)->where('store_id',$order['store_id'])->find(); + $find = StoreBranchProduct::where('product_id', $value->product_id)->where('store_id',$order['store_id'])->withTrashed()->find(); }else{ - $find = StoreProduct::where('id', $value->product_id)->find(); + $find = StoreProduct::where('id', $value->product_id)->withTrashed()->find(); } $value->store_name = $find['store_name'] ?? ''; $value->store_info = $find['store_info'] ?? ''; @@ -311,7 +311,7 @@ class WarehouseOrderController extends BaseAdminController $system_store = SystemStore::where('id', $warehouseOrder['store_id'])->value('introduction'); $data = WarehouseProduct::where('oid', $id)->where('financial_pm',0)->field('oid,product_id,nums')->select() ->each(function ($item) use ($system_store,$warehouseOrder) { - $find = StoreProduct::where('id', $item['product_id'])->field('store_name,unit')->find(); + $find = StoreProduct::where('id', $item['product_id'])->field('store_name,unit')->withTrashed()->find(); $unit_name = StoreProductUnit::where('id', $find['unit'])->value('name'); $item['system_store'] = $system_store; $item['subtitle'] = $item['oid'].' '.convertStringToNumber($item['nums']).'/'.$unit_name; diff --git a/app/admin/lists/store_product/StoreProductLists.php b/app/admin/lists/store_product/StoreProductLists.php index cae8c5759..7af3427e6 100644 --- a/app/admin/lists/store_product/StoreProductLists.php +++ b/app/admin/lists/store_product/StoreProductLists.php @@ -100,7 +100,8 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa } $item['unit_name'] = StoreProductUnit::where('id', $item['unit'])->value('name'); $stock = StoreBranchProduct::where('store_id', '<>', '4')->where('product_id', $item['id'])->sum('stock'); - $item['cate_name'] = StoreCategory::where('id', $item['cate_id'])->value('name'); + $category = StoreCategory::where('id','in',[$item['top_cate_id'],$item['two_cate_id'],$item['cate_id']])->column('name'); + $item['cate_name'] =implode('/', $category); if($is_warehouse==1){ $item['stock'] = WarehouseProductStorege::where('product_id', $item['id'])->sum('nums'); }else{