fix: [payroll] 급여목록 정렬 기준을 입사일 오름차순으로 변경
This commit is contained in:
@@ -48,7 +48,13 @@ private function buildFilteredQuery(array $filters = [])
|
||||
$month = $filters['month'] ?? now()->month;
|
||||
$query->forPeriod((int) $year, (int) $month);
|
||||
|
||||
return $query->orderBy('created_at', 'desc');
|
||||
return $query
|
||||
->leftJoin('tenant_user_profiles as emp', function ($join) use ($tenantId) {
|
||||
$join->on('payrolls.user_id', '=', 'emp.user_id')
|
||||
->where('emp.tenant_id', '=', $tenantId);
|
||||
})
|
||||
->select('payrolls.*')
|
||||
->orderByRaw("COALESCE(emp.json_extra->>'$.hire_date', '9999-12-31') ASC");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user