From 61a5d5d6d5f34a263db15b8816e94e57c7a1adae Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 27 Oct 2024 18:09:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(warehouse):=20=E4=BB=93=E5=BA=93=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在仓库产品列表中添加分类名称字段 - 优化产品信息查询,包含分类 ID - 修复部分产品无规格信息的问题 - 注释掉 OperationLog 中的 json 属性 --- app/admin/lists/warehouse_product/WarehouseProductLists.php | 6 +++++- app/common/model/OperationLog.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/admin/lists/warehouse_product/WarehouseProductLists.php b/app/admin/lists/warehouse_product/WarehouseProductLists.php index 8dbdc117..a9c4a473 100644 --- a/app/admin/lists/warehouse_product/WarehouseProductLists.php +++ b/app/admin/lists/warehouse_product/WarehouseProductLists.php @@ -11,6 +11,7 @@ use app\common\model\store_product\StoreProduct; use app\common\model\system_store\SystemStore; use app\common\model\warehouse\Warehouse; use app\common\lists\ListsExcelInterface; +use app\common\model\store_category\StoreCategory; use app\common\model\store_product_unit\StoreProductUnit; use app\common\model\supplier\Supplier; @@ -81,6 +82,7 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt $item->price = ''; $item->unit_name = ''; $item->store_info = ''; + $item->top_cate_name = ''; if ($item->financial_pm == 0) { $item->financial_pm_name = '出库'; } else { @@ -104,13 +106,14 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt $item->admin_name = ''; } if ($item->product_id) { - $find = StoreProduct::where('id', $item->product_id)->field('price,image,store_name,unit,store_info')->find(); + $find = StoreProduct::where('id', $item->product_id)->field('price,image,store_name,unit,store_info,top_cate_id')->withTrashed()->find(); if($find){ $item->store_name = $find->store_name . '|' . $item->product_id; $item->image = $find->image; $item->price = $find->price; $item->unit_name = StoreProductUnit::where('id', $find->unit)->value('name'); $item->store_info =$find->store_info; + $item->top_cate_name =StoreCategory::where('id', $find->top_cate_id)->value('name'); } } if ($item->warehouse_id) { @@ -191,6 +194,7 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt 'admin_name' => '操作人员', 'warehouse_name' => '仓库', 'store_name' => '商品名称', + 'top_cate_name' => '分类', 'store_info' => '规格', 'unit_name' => '单位', 'financial_pm_name' => '出入库', diff --git a/app/common/model/OperationLog.php b/app/common/model/OperationLog.php index fd72f600..ff67252f 100644 --- a/app/common/model/OperationLog.php +++ b/app/common/model/OperationLog.php @@ -6,6 +6,6 @@ namespace app\common\model; class OperationLog extends BaseModel { - protected $json = ['params']; + // protected $json = ['params']; } \ No newline at end of file