Files
confirms/app/Models/Entities/ChangedHistoryModel.php
2026-04-27 15:03:36 +09:00

48 lines
1.0 KiB
PHP

<?php
namespace App\Models\Entities;
use CodeIgniter\Model;
class ChangedHistoryModel extends Model
{
protected $table = 'changed_history';
protected $primaryKey = 'seq';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $protectFields = true;
protected $allowedFields = [
'rcpt_sq',
'rcpt_stat',
'changed_type',
'changed_id',
'changed_tm',
'remark',
];
/**
* 정보변경 이력 1건 저장
*/
public function addHistory(
int $rcptSq,
?string $rcptStat,
?string $changedType,
?string $changedId,
?string $remark,
?string $changedTm = null
): bool {
$data = [
'rcpt_sq' => $rcptSq,
'rcpt_stat' => $rcptStat,
'changed_type' => $changedType,
'changed_id' => $changedId,
'changed_tm' => $changedTm ?? date('Y-m-d H:i:s'),
'remark' => $remark,
];
return $this->insert($data) !== false;
}
}