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(), ]); }