fix: 修复更新用户的逻辑bug (#282)
This commit is contained in:
parent
5343539efe
commit
d00d6df8a1
|
@ -217,23 +217,21 @@ func (l UserLogic) Update(c *gin.Context, req interface{}) (data interface{}, rs
|
||||||
return nil, tools.NewMySqlError(err)
|
return nil, tools.NewMySqlError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 过滤掉前端会选择到的 请选择部门信息 这个选项
|
||||||
var (
|
var (
|
||||||
depts string
|
depts string
|
||||||
deptids []uint
|
deptids []uint
|
||||||
)
|
)
|
||||||
if strings.Contains(r.Departments, "请选择部门信息") {
|
for _, v := range strings.Split(r.Departments, ",") {
|
||||||
for _, v := range strings.Split(r.Departments, ",") {
|
if v != "请选择部门信息" {
|
||||||
if v != "请选择部门信息" {
|
depts += v + ","
|
||||||
depts += v + ","
|
}
|
||||||
}
|
}
|
||||||
}
|
for _, j := range r.DepartmentId {
|
||||||
for _, j := range r.DepartmentId {
|
if j != 0 {
|
||||||
if j != 0 {
|
deptids = append(deptids, j)
|
||||||
deptids = append(deptids, j)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fmt.Println(depts, deptids)
|
|
||||||
|
|
||||||
// 拼装新的用户信息
|
// 拼装新的用户信息
|
||||||
user := model.User{
|
user := model.User{
|
||||||
|
|
Loading…
Reference in New Issue