fix(过滤离职):完善优化过滤离职人员
deploy-hxtesting / build-and-deploy (push) Successful in 1m35s

This commit is contained in:
runny committed 2026-12-01 18:21:46 +08:00
1 parent 381dd60bea
commit f55447a8f8
5 files changed
+17

No files matched your search

@@ -81,6 +81,12 @@ func (r *orgCenterRepository) employeeFilter(ctx context.Context, tenantID uint6
if q.EmploymentStatus > 0 {
tx = tx.Where("u.employment_status = ?", q.EmploymentStatus)
}
// 在职口径过滤:员工档案列表只保留成员管理在职人员(状态 1-5),
// 离职(6)/退休(7)不再展示;users 联查不上的档案行同样视作不在职隐藏。
if q.OnDutyOnly {
tx = tx.Where("u.employment_status BETWEEN ? AND ?",
types.EmploymentStatusProbation, types.EmploymentStatusIntern)
}
if q.Keyword != "" {
// 按姓名/工号/部门名/岗位模糊查找;姓名取真实姓名(display_name)
// 回退平台账号(username),与列表展示口径一致。