fix: wecom user list
CI / admin (push) Has been skipped
CI / bff (push) Has been skipped
CI / chore (push) Has been skipped
CI / express (push) Has been skipped
CI / product (push) Has been skipped
CI / sale (push) Has been skipped
CI / user (push) Has been skipped
CI / wecom (push) Has been skipped
CI / changes (push) Successful in 12s
CI / ad (push) Successful in 0s
CI / admin (push) Has been skipped
CI / bff (push) Has been skipped
CI / chore (push) Has been skipped
CI / express (push) Has been skipped
CI / product (push) Has been skipped
CI / sale (push) Has been skipped
CI / user (push) Has been skipped
CI / wecom (push) Has been skipped
CI / changes (push) Successful in 12s
CI / ad (push) Successful in 0s
This commit is contained in:
@@ -70,7 +70,7 @@ func (l *UpdateUserLogic) UpdateUser(in *wecom.UpdateUserReq) (*wecom.Response,
|
||||
}
|
||||
typeVal := row.Type
|
||||
if req.Type > utils.NumberZero {
|
||||
typeVal = row.Type
|
||||
typeVal = uint8(req.Type)
|
||||
}
|
||||
userStatus := resolveStatus(req.Status, row.Status)
|
||||
|
||||
@@ -109,16 +109,25 @@ func (l *UpdateUserLogic) UpdateUser(in *wecom.UpdateUserReq) (*wecom.Response,
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := m.Edit(modelbase.Params{
|
||||
Eq: map[string]string{"id": strconv.FormatInt(row.Id, utils.NumberTen)},
|
||||
}, map[string]interface{}{
|
||||
data := map[string]interface{}{
|
||||
"name": name,
|
||||
"mobile": encryptMobile,
|
||||
"avatar": avatar,
|
||||
"status": userStatus,
|
||||
"type": typeVal,
|
||||
"updated_at": utils.Now(),
|
||||
}); err != nil {
|
||||
}
|
||||
if len(req.AgentIds) > utils.NumberZero {
|
||||
agentsJSON, aErr := buildAgentsJSON(req.AgentIds)
|
||||
if aErr != nil {
|
||||
l.Errorf("wecom update agents: %v", aErr)
|
||||
return outResponse(utils.ErrorParams, aErr.Error()), nil
|
||||
}
|
||||
data["agent_ids"] = agentsJSON
|
||||
}
|
||||
if _, err := m.Edit(modelbase.Params{
|
||||
Eq: map[string]string{"id": strconv.FormatInt(row.Id, utils.NumberTen)},
|
||||
}, data); err != nil {
|
||||
l.Errorf("wecom update user db: %v", err)
|
||||
return failResponse(utils.Fail), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user