mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 20:30:40 +08:00
Merge remote-tracking branch 'origin/superGroup' into superGroup
This commit is contained in:
commit
0babf89aa5
@ -147,7 +147,7 @@ func joinGroups(operationID, userID, userName string, groupIDList []string) {
|
|||||||
GroupID: groupID,
|
GroupID: groupID,
|
||||||
Reason: "register auto join",
|
Reason: "register auto join",
|
||||||
InvitedUserIDList: []string{userID},
|
InvitedUserIDList: []string{userID},
|
||||||
OpUserID: userID,
|
OpUserID: config.Config.Manager.AppManagerUid[0],
|
||||||
}
|
}
|
||||||
resp, err := client.InviteUserToGroup(context.Background(), req)
|
resp, err := client.InviteUserToGroup(context.Background(), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -249,10 +249,14 @@ func GetDepartmentRelatedGroupIDList(departmentIDList []string) ([]string, error
|
|||||||
|
|
||||||
func getDepartmentParent(departmentID string, dbConn *gorm.DB) (*db.Department, error) {
|
func getDepartmentParent(departmentID string, dbConn *gorm.DB) (*db.Department, error) {
|
||||||
var department db.Department
|
var department db.Department
|
||||||
|
var parentDepartment db.Department
|
||||||
//var parentID string
|
//var parentID string
|
||||||
dbConn.LogMode(true)
|
dbConn.LogMode(true)
|
||||||
dbConn.Model(&department).Where("department_id=?", departmentID).Select("parent_id").First(&department)
|
err := dbConn.Model(&department).Where("department_id=?", departmentID).Select("parent_id").First(&department).Error
|
||||||
err := dbConn.Model(&department).Where("department_id = ?", department.ParentID).Find(&department).Error
|
if err != nil {
|
||||||
|
return nil, utils.Wrap(err, "")
|
||||||
|
}
|
||||||
|
err = dbConn.Model(&parentDepartment).Where("department_id = ?", department.ParentID).Find(&parentDepartment).Error
|
||||||
return &department, err
|
return &department, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +265,7 @@ func GetDepartmentParent(departmentID string, dbConn *gorm.DB, parentIDList *[]s
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if department.ParentID != "" {
|
if department.DepartmentID != "" {
|
||||||
*parentIDList = append(*parentIDList, department.ParentID)
|
*parentIDList = append(*parentIDList, department.ParentID)
|
||||||
err = GetDepartmentParent(departmentID, dbConn, parentIDList)
|
err = GetDepartmentParent(departmentID, dbConn, parentIDList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user