diff --git a/app/common/model/store_branch_product/StoreBranchProduct.php b/app/common/model/store_branch_product/StoreBranchProduct.php index 4f782f0f0..f36b7d9d7 100644 --- a/app/common/model/store_branch_product/StoreBranchProduct.php +++ b/app/common/model/store_branch_product/StoreBranchProduct.php @@ -68,25 +68,4 @@ class StoreBranchProduct extends BaseModel { return $this->hasOne(StoreProduct::class,'id','product_id'); } - public static function onBeforeWrite($data) - { - try { - $where = $data->getWhere(); - if($data){ - $find = self::where($where)->field(array_keys($data->toArray()))->find(); - if($find){ - channelLog(array_merge($find->toArray(), $where),'branch_product','更新前'); - } - } - } catch (Throwable $e) { - Log::error('branch_product:' . $e->getMessage()); - } - } - public static function onAfterWrite($data){ - try{ - channelLog($data->toArray(),'branch_product','更新后'); - }catch(Throwable $e){ - Log::error('branch_product:'.$e->getMessage()); - } - } } \ No newline at end of file diff --git a/app/common/model/warehouse_product/WarehouseProduct.php b/app/common/model/warehouse_product/WarehouseProduct.php index 451a42768..54cbcbd3e 100644 --- a/app/common/model/warehouse_product/WarehouseProduct.php +++ b/app/common/model/warehouse_product/WarehouseProduct.php @@ -46,26 +46,4 @@ class WarehouseProduct extends BaseModel 'create_time', 'update_time', ]; - public static function onBeforeWrite($data) - { - try { - $where = $data->getWhere(); - if($data){ - $find = self::where($where)->field(array_keys($data->toArray()))->find(); - if($find){ - channelLog(array_merge($find->toArray(), $where),'warehouse_product','更新前'); - } - } - } catch (Throwable $e) { - Log::error('warehouse_product:' . $e->getMessage()); - } - } - - public static function onAfterWrite($data){ - try{ - channelLog($data->toArray(),'warehouse_product','更新后'); - }catch(Throwable $e){ - Log::error('warehouse_product:'.$e->getMessage()); - } - } } \ No newline at end of file diff --git a/app/common/model/warehouse_product_storege/WarehouseProductStorege.php b/app/common/model/warehouse_product_storege/WarehouseProductStorege.php index 4dfe1a65f..927b771e3 100644 --- a/app/common/model/warehouse_product_storege/WarehouseProductStorege.php +++ b/app/common/model/warehouse_product_storege/WarehouseProductStorege.php @@ -23,26 +23,4 @@ class WarehouseProductStorege extends BaseModel 'total_price', 'update_time', ]; - public static function onBeforeWrite($data) - { - try { - $where = $data->getWhere(); - if($data){ - $find = self::where($where)->field(array_keys($data->toArray()))->find(); - if($find){ - channelLog(array_merge($find->toArray(), $where), 'warehouse_product_storege', '更新前'); - } - } - } catch (Throwable $e) { - Log::error('warehouse_product_storege:' . $e->getMessage()); - } - } - public static function onAfterWrite($data) - { - try { - channelLog($data->toArray(), 'warehouse_product_storege', '更新后'); - } catch (Throwable $e) { - Log::error('warehouse_product_storege:' . $e->getMessage()); - } - } }