...
|
...
|
@@ -377,25 +377,26 @@ func GetDepartmentUser(companyid int64, departmentid int64) ([]protocol.DepartUs |
|
|
department *models.Department
|
|
|
err error
|
|
|
)
|
|
|
var (
|
|
|
returnData []protocol.DepartUserBase
|
|
|
)
|
|
|
department, err = models.GetDepartmentById(departmentid)
|
|
|
if err != nil {
|
|
|
log.Error("获取部门失败:%s", err)
|
|
|
return nil, nil
|
|
|
return returnData, nil
|
|
|
}
|
|
|
if department.CompanyId != companyid {
|
|
|
log.Error("deparment.CompanyId err")
|
|
|
return nil, protocol.NewErrWithMessage("1")
|
|
|
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
|
|
|
WHERE a.department_id=? AND b.delete_at=0 AND a.enable_status = 1 `
|
|
|
var (
|
|
|
returnData []protocol.DepartUserBase
|
|
|
)
|
|
|
|
|
|
err = utils.ExecuteQueryAll(&returnData, dataSql, department.Id)
|
|
|
if err != nil {
|
|
|
log.Error("EXECUTE SQL err:%s", err)
|
|
|
return nil, protocol.NewErrWithMessage("1")
|
|
|
return returnData, protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
return returnData, nil
|
|
|
} |
...
|
...
|
|