fix: 출근체크/근무현황 페이지 버그 수정
- workers API 기본 limit 10 → 100 변경 (작업자 누락 문제 해결) - 작업자 필터 조건 수정 (status='active' + employment_status 체크) - 근태 기록 저장 시 컬럼명 불일치 수정 (attendance_type_id) - 근무현황 페이지에 저장 상태 표시 추가 (✓저장됨) - 디버그 로그 제거 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -201,13 +201,15 @@ class AttendanceModel {
|
||||
const {
|
||||
record_date,
|
||||
worker_id,
|
||||
total_work_hours,
|
||||
work_attendance_type_id,
|
||||
vacation_type_id,
|
||||
is_overtime_approved,
|
||||
created_by
|
||||
total_work_hours = 8,
|
||||
work_attendance_type_id = 1,
|
||||
vacation_type_id = null,
|
||||
is_overtime_approved = false,
|
||||
created_by = 1
|
||||
} = recordData;
|
||||
|
||||
const attendance_type_id = work_attendance_type_id;
|
||||
|
||||
// 기존 기록 확인
|
||||
const [existing] = await db.execute(
|
||||
'SELECT id FROM daily_attendance_records WHERE worker_id = ? AND record_date = ?',
|
||||
@@ -217,17 +219,17 @@ class AttendanceModel {
|
||||
if (existing.length > 0) {
|
||||
// 업데이트
|
||||
const [result] = await db.execute(`
|
||||
UPDATE daily_attendance_records
|
||||
SET
|
||||
UPDATE daily_attendance_records
|
||||
SET
|
||||
total_work_hours = ?,
|
||||
work_attendance_type_id = ?,
|
||||
attendance_type_id = ?,
|
||||
vacation_type_id = ?,
|
||||
is_overtime_approved = ?,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
WHERE id = ?
|
||||
`, [
|
||||
total_work_hours,
|
||||
work_attendance_type_id,
|
||||
attendance_type_id,
|
||||
vacation_type_id,
|
||||
is_overtime_approved,
|
||||
existing[0].id
|
||||
@@ -238,14 +240,14 @@ class AttendanceModel {
|
||||
// 생성
|
||||
const [result] = await db.execute(`
|
||||
INSERT INTO daily_attendance_records (
|
||||
record_date, worker_id, total_work_hours, work_attendance_type_id,
|
||||
record_date, worker_id, total_work_hours, attendance_type_id,
|
||||
vacation_type_id, is_overtime_approved, created_by
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
||||
`, [
|
||||
record_date,
|
||||
worker_id,
|
||||
total_work_hours,
|
||||
work_attendance_type_id,
|
||||
attendance_type_id,
|
||||
vacation_type_id,
|
||||
is_overtime_approved,
|
||||
created_by
|
||||
|
||||
Reference in New Issue
Block a user