Files
jongryangje/app/Models/MemberModel.php
taekyoungc 8d49247803 feat: 사용자 작업(감사) 로그 자동 기록 + 관리자 조회 화면
- 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>
2026-06-25 17:13:05 +09:00

52 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use CodeIgniter\Model;
class MemberModel extends Model
{
use \App\Models\Traits\Auditable;
protected $table = 'member';
protected $primaryKey = 'mb_idx';
protected $returnType = 'object';
protected $useTimestamps = false;
protected $allowedFields = [
'mb_id',
'mb_passwd',
'mb_totp_secret',
'mb_totp_enabled',
'mb_name',
'mb_email',
'mb_phone',
'mb_lang',
'mb_level',
'mb_group',
'mb_lg_idx',
'mb_state',
'mb_regdate',
'mb_latestdate',
'mb_leavedate',
'mb_login_fail_count',
'mb_locked_until',
'mb_session_token',
];
/**
* mb_id로 회원 조회
*/
public function findByLoginId(string $mbId): ?object
{
return $this->where('mb_id', $mbId)->first();
}
/**
* mb_id 중복 여부
*/
public function isIdExists(string $mbId): bool
{
return $this->where('mb_id', $mbId)->countAllResults() > 0;
}
}