mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
fix bug
This commit is contained in:
parent
7b08d98647
commit
c8bf95578c
@ -265,7 +265,9 @@ func getDepartmentParent(departmentID string, dbConn *gorm.DB) (*db.Department,
|
||||
if err != nil {
|
||||
return nil, utils.Wrap(err, "")
|
||||
}
|
||||
err = dbConn.Model(&parentDepartment).Where("department_id = ?", department.ParentID).Find(&parentDepartment).Error
|
||||
if department.ParentID != "" {
|
||||
err = dbConn.Model(&parentDepartment).Where("department_id = ?", department.ParentID).Find(&parentDepartment).Error
|
||||
}
|
||||
return &parentDepartment, utils.Wrap(err, "")
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user