diff --git a/system1-factory/api/models/attendanceModel.js b/system1-factory/api/models/attendanceModel.js index 844e813..84678e9 100644 --- a/system1-factory/api/models/attendanceModel.js +++ b/system1-factory/api/models/attendanceModel.js @@ -150,9 +150,10 @@ class AttendanceModel { static async initializeDailyRecords(date, createdBy) { const db = await getDb(); - // 1. 활성 작업자 조회 + // 1. 활성 작업자 조회 (입사일 이전 제외) const [workers] = await db.execute( - 'SELECT user_id FROM workers WHERE status = "active" AND user_id IS NOT NULL' + 'SELECT user_id FROM workers WHERE status = "active" AND user_id IS NOT NULL AND (hire_date IS NULL OR hire_date <= ?)', + [date] ); if (workers.length === 0) return { inserted: 0 };