def get_user_data(user_role, user_id=None, department_id=None):
if user_role == UserRole.ADMIN:
return db.query(“SELECT * FROM attendance_data”)
elif user_role == UserRole.SUPERVISOR:
return db.query(“SELECT * FROM attendance_data WHERE department_id = ?”, (department_id,))
elif user_role == UserRole.EMPLOYEE:
return db.query(“SELECT * FROM attendance_data WHERE user_id = ?”, (user_id,))
利唐i人事HR社区,发布者:HR数字化研究员,转转请注明出处:https://www.ihr360.com/hrnews/20241246673.html