...
|
...
|
@@ -338,7 +338,7 @@ func GetRoleHasRole(roleid int64, companyid int64) ([]protocol.RoleHasUser, erro |
|
|
datasql string = `SELECT user_company_id FROM user_role
|
|
|
WHERE company_id=? AND role_id =? AND enable_status = 1`
|
|
|
datasql2 string = `SELECT a.nick_name,b.id AS user_company_id FROM user AS a,user_company AS b
|
|
|
WHERE a.id= b.user_id AND b.id IN(?)`
|
|
|
WHERE a.id= b.user_id AND b.id IN(%s)`
|
|
|
)
|
|
|
err = utils.ExecuteQueryAll(&ucid, datasql, companyid, roleid)
|
|
|
if err != nil {
|
...
|
...
|
@@ -348,9 +348,10 @@ func GetRoleHasRole(roleid int64, companyid int64) ([]protocol.RoleHasUser, erro |
|
|
if len(ucid) == 0 {
|
|
|
return roleuserlist, nil
|
|
|
}
|
|
|
err = utils.ExecuteQueryAll(&roleuserlist, datasql2, strings.Join(ucid, ","))
|
|
|
err = utils.ExecuteQueryAll(&roleuserlist, fmt.Sprintf(datasql2, strings.Join(ucid, ",")))
|
|
|
if err != nil {
|
|
|
log.Error("获取用户时间失败;%s", err)
|
|
|
log.Error("获取用户数据失败;%s", err)
|
|
|
}
|
|
|
|
|
|
return roleuserlist, nil
|
|
|
} |
...
|
...
|
|