From 24cd3ef82829dc16a746ba7e5367825559f68fb2 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 4 Jan 2025 12:40:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(model):=20=E6=B7=BB=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=BF=BD=E7=95=A5=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 StoreBranchProduct、WarehouseProduct 和 WarehouseProductStorege 模型中添加 $ignoreLogFields 属性 - 设置需要忽略日志记录的字段列表,以保护敏感信息和减少不必要的日志数据 --- .../StoreBranchProduct.php | 29 ++++++++++++++++++- .../warehouse_product/WarehouseProduct.php | 29 ++++++++++++++++++- .../WarehouseProductStorege.php | 6 +++- 3 files changed, 61 insertions(+), 3 deletions(-) diff --git a/app/common/model/store_branch_product/StoreBranchProduct.php b/app/common/model/store_branch_product/StoreBranchProduct.php index 494edb295..4f782f0f0 100644 --- a/app/common/model/store_branch_product/StoreBranchProduct.php +++ b/app/common/model/store_branch_product/StoreBranchProduct.php @@ -21,7 +21,34 @@ class StoreBranchProduct extends BaseModel use SoftDelete; protected $name = 'store_branch_product'; protected $deleteTime = 'delete_time'; - + public $ignoreLogFields = [ + 'top_cate_id', + 'two_cate_id', + 'cate_id', + 'store_name', + 'image', + 'price', + 'vip_price', + 'cost', + 'purchase', + 'total_price', + 'store_info', + 'keyword', + 'bar_code', + 'rose', + 'status', + 'product_type', + 'unit', + 'batch', + 'store_batch', + 'sort', + 'label_id', + 'is_lack', + 'manufacturer_information', + 'status', + 'create_time', + 'update_time', + ]; public function unitName() diff --git a/app/common/model/warehouse_product/WarehouseProduct.php b/app/common/model/warehouse_product/WarehouseProduct.php index fb086e088..451a42768 100644 --- a/app/common/model/warehouse_product/WarehouseProduct.php +++ b/app/common/model/warehouse_product/WarehouseProduct.php @@ -18,7 +18,34 @@ class WarehouseProduct extends BaseModel use SoftDelete; protected $name = 'warehouse_product'; protected $deleteTime = 'delete_time'; - + public $ignoreLogFields = [ + 'price', + 'total_price', + 'status', + 'pay_type', + 'is_pay', + 'vip_price', + 'cost', + 'purchase', + 'total_price', + 'mark', + 'after_nums', + 'before_nums', + 'batch', + 'enter_admin_id', + 'admin_id', + 'financial_pm', + 'expiration_date', + 'manufacture', + 'code', + 'oid', + 'unit', + 'store_id', + 'supplier_id', + 'warehouse_id', + 'create_time', + 'update_time', + ]; public static function onBeforeWrite($data) { try { diff --git a/app/common/model/warehouse_product_storege/WarehouseProductStorege.php b/app/common/model/warehouse_product_storege/WarehouseProductStorege.php index 172b611f8..4dfe1a65f 100644 --- a/app/common/model/warehouse_product_storege/WarehouseProductStorege.php +++ b/app/common/model/warehouse_product_storege/WarehouseProductStorege.php @@ -18,7 +18,11 @@ class WarehouseProductStorege extends BaseModel use SoftDelete; protected $name = 'warehouse_product_storege'; protected $deleteTime = 'delete_time'; - + public $ignoreLogFields = [ + 'price', + 'total_price', + 'update_time', + ]; public static function onBeforeWrite($data) { try {