跟进时间

This commit is contained in:
2025-08-22 14:31:33 +08:00
parent c6908e57cc
commit cb7d5078fe
3 changed files with 24 additions and 7 deletions
+17 -6
View File
@@ -36,11 +36,22 @@ class Follow extends Model
*
* @var bool
*/
public $timestamps = true;
public $timestamps = false;
protected $casts = [
'follow_time' => 'timestamp', // 指定序列化格式
'updated_at' => 'timestamp', // 指定序列化格式
'created_at' => 'timestamp', // 指定序列化格式
];
/**
* 在保存时手动设置时间戳
*/
protected static function boot()
{
parent::boot();
static::creating(function ($model) {
$model->created_at = time();
$model->updated_at = time();
});
static::updating(function ($model) {
$model->updated_at = time();
});
}
}