fix:修复bug

This commit is contained in:
henry
2021-11-25 13:53:18 +08:00
parent c6b37755b9
commit a90a7880de
4 changed files with 47 additions and 21 deletions

View File

@ -53,7 +53,21 @@ func (m *WorkSchedule) CountersignStatus() bool {
}
func (m *WorkSchedule) GetTargetValueAttribute() []string {
return strings.Split(m.TargetValue, ",")
if m.Target == WorkScheduleTargetForPerson {
return strings.Split(m.TargetValue, ",")
} else if m.Target == WorkScheduleTargetForRole {
// 查询角色绑定的用户信息
mSysUserRole := NewSysUserRole()
roleIDs := strings.Split(m.TargetValue, ",")
uids := make([]string, 0)
_ = Pluck(mSysUserRole, "uid", &uids, NewWhereIn("role_id", roleIDs))
return uids
}
return []string{}
}
func (m *WorkSchedule) SetTargetValueAttribute(value []string) {