- Auditable 트레잇: 모델 insert/update/delete 시 activity_log 자동 기록 (조회 제외, before/after JSON, 민감필드 마스킹, 사용자/IP) - 도메인 모델 28개에 적용 (로그성 테이블 제외) - 관리자 전용 조회: Admin\ActivityLog (기간/작업/대상/사용자 필터 + 상세 변경내역) - 라우트 admin/access/activity-logs(+상세), 메뉴 '활동 로그' 추가 - 테넌트 분리: 슈퍼=전체, 지자체관리자=소속 지자체만 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
39 lines
927 B
PHP
39 lines
927 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class MemberApprovalRequestModel extends Model
|
|
{
|
|
use \App\Models\Traits\Auditable;
|
|
|
|
public const STATUS_PENDING = 'pending';
|
|
public const STATUS_APPROVED = 'approved';
|
|
public const STATUS_REJECTED = 'rejected';
|
|
|
|
protected $table = 'member_approval_request';
|
|
protected $primaryKey = 'mar_idx';
|
|
protected $returnType = 'object';
|
|
protected $useTimestamps = false;
|
|
protected $allowedFields = [
|
|
'mb_idx',
|
|
'mar_requested_level',
|
|
'mar_status',
|
|
'mar_request_note',
|
|
'mar_reject_reason',
|
|
'mar_requested_at',
|
|
'mar_requested_by',
|
|
'mar_processed_at',
|
|
'mar_processed_by',
|
|
];
|
|
|
|
public function getLatestByMember(int $mbIdx): ?object
|
|
{
|
|
return $this->where('mb_idx', $mbIdx)
|
|
->orderBy('mar_idx', 'DESC')
|
|
->first();
|
|
}
|
|
}
|
|
|