...
|
...
|
@@ -380,8 +380,9 @@ func GetDepartmentUser(companyid int64, departmentid int64) ([]protocol.DepartUs |
|
|
log.Error("deparment.CompanyId err")
|
|
|
return returnData, protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
const dataSql string = `SELECT b.nick_name,a.user_company_id FROM user_department AS a
|
|
|
JOIN user_company AS b ON a.user_company_id = b.id
|
|
|
const dataSql string = `SELECT a.user_company_id,b.user_id
|
|
|
FROM user_department AS a
|
|
|
LEFT JOIN user_company AS b ON a.user_company_id = b.id
|
|
|
WHERE a.department_id=? AND b.delete_at=0 AND a.enable_status = 1 `
|
|
|
|
|
|
err = utils.ExecuteQueryAll(&returnData, dataSql, department.Id)
|
...
|
...
|
@@ -389,5 +390,13 @@ func GetDepartmentUser(companyid int64, departmentid int64) ([]protocol.DepartUs |
|
|
log.Error("EXECUTE SQL err:%s", err)
|
|
|
return returnData, protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
for i := range returnData {
|
|
|
uInfo, err := models.GetUserById(returnData[i].UserId)
|
|
|
if err == nil {
|
|
|
returnData[i].NickName = uInfo.NickName
|
|
|
} else {
|
|
|
log.Error("GetUserById(%d) err:%s", returnData[i].UserId, err)
|
|
|
}
|
|
|
}
|
|
|
return returnData, nil
|
|
|
} |
...
|
...
|
|