From 73ce99edfbadece416e1db37a9e9a2d664cc2298 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Wed, 25 Feb 2026 14:46:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E5=93=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/InvStockLog.php | 13 ++++++++++--- app/common/service/InvItemService.php | 2 ++ app/common/service/InvStockLogService.php | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/common/model/InvStockLog.php b/app/common/model/InvStockLog.php index 7c580df..f8c4aac 100644 --- a/app/common/model/InvStockLog.php +++ b/app/common/model/InvStockLog.php @@ -24,12 +24,19 @@ class InvStockLog extends Model 'operator_id', 'operator_name', 'remark', + 'updated_at', 'created_at', ]; - protected $casts = [ - 'created_at' => 'timestamp', - ]; + /** + * Indicates if the model should be timestamped. + * + * @var bool + */ + public $timestamps = true; + + + protected $dateFormat = 'U'; public const CHANGE_TYPE_IN = 1; // 入库 public const CHANGE_TYPE_OUT_CLAIM = 2; // 出库(领用) diff --git a/app/common/service/InvItemService.php b/app/common/service/InvItemService.php index 4048d1f..d107a75 100644 --- a/app/common/service/InvItemService.php +++ b/app/common/service/InvItemService.php @@ -159,6 +159,8 @@ class InvItemService 'operator_name' => $name, 'remark' => '管理员修改数量', ], $change_qty); + + return $data; } /** diff --git a/app/common/service/InvStockLogService.php b/app/common/service/InvStockLogService.php index c2ab23c..8153a9f 100644 --- a/app/common/service/InvStockLogService.php +++ b/app/common/service/InvStockLogService.php @@ -39,6 +39,7 @@ class InvStockLogService 'operator_id' => $data['operator_id'] ?? null, 'operator_name' => $data['operator_name'] ?? null, 'remark' => $data['remark'] ?? null, + 'updated_at' => time(), 'created_at' => time(), ]); }