feat: HR 모델 userProfile 관계 추가 및 서비스 개선
## 모델 개선 - Leave: userProfile relation 추가 - Salary: userProfile relation 추가 - TenantUserProfile: department, position 관계 및 label accessor 추가 ## 서비스 개선 - LeaveService: userProfile eager loading 추가 - SalaryService: 사원 정보 조회 개선 - CardService: 관계 정리 및 개선 - AttendanceService: 조회 기능 개선 ## 시더 - DummySalarySeeder 추가 - DummyCardSeeder 멀티테넌트 지원 개선 - DummyDataSeeder에 급여 시더 등록 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,13 @@ public function index(array $params): LengthAwarePaginator
|
||||
|
||||
$query = Attendance::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->with(['user:id,name,email']);
|
||||
->with([
|
||||
'user:id,name,email',
|
||||
'user.tenantProfiles' => function ($q) use ($tenantId) {
|
||||
$q->where('tenant_id', $tenantId)
|
||||
->with('department:id,name');
|
||||
},
|
||||
]);
|
||||
|
||||
// 사용자 필터
|
||||
if (! empty($params['user_id'])) {
|
||||
@@ -69,7 +75,13 @@ public function show(int $id): Attendance
|
||||
|
||||
$attendance = Attendance::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->with(['user:id,name,email'])
|
||||
->with([
|
||||
'user:id,name,email',
|
||||
'user.tenantProfiles' => function ($q) use ($tenantId) {
|
||||
$q->where('tenant_id', $tenantId)
|
||||
->with('department:id,name');
|
||||
},
|
||||
])
|
||||
->findOrFail($id);
|
||||
|
||||
return $attendance;
|
||||
|
||||
Reference in New Issue
Block a user