From 53281eef3daeb5d944ffda77c69b8bc552c895cc Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 19 Apr 2022 20:57:59 +0800 Subject: [PATCH] Organization --- internal/rpc/msg/organization_notification.go | 2 +- .../db/mysql_model/im_mysql_model/organization_model.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/rpc/msg/organization_notification.go b/internal/rpc/msg/organization_notification.go index cfe4222b1..d9dd6fd52 100644 --- a/internal/rpc/msg/organization_notification.go +++ b/internal/rpc/msg/organization_notification.go @@ -28,7 +28,7 @@ func OrganizationNotificationToAll(opUserID string, operationID string) { utils2.UserDBCopyOpenIM(tips.OpUser, user) for _, v := range userIDList { - log.Debug(operationID, opUserID, v, constant.OrganizationChangedNotification, &tips, operationID) + log.Debug(operationID, "OrganizationNotification", opUserID, v, constant.OrganizationChangedNotification, &tips, operationID) OrganizationNotification(opUserID, v, constant.OrganizationChangedNotification, &tips, operationID) } } diff --git a/pkg/common/db/mysql_model/im_mysql_model/organization_model.go b/pkg/common/db/mysql_model/im_mysql_model/organization_model.go index 1bfb02038..c3005fcec 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/organization_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/organization_model.go @@ -186,7 +186,12 @@ func GetDepartmentMemberList(departmentID string) (error, []db.DepartmentMember) return err, nil } var departmentMemberList []db.DepartmentMember - err = dbConn.Table("department_members").Where("department_id=?", departmentID).Find(&departmentMemberList).Error + if departmentID == "-1" { + err = dbConn.Table("department_members").Find(&departmentMemberList).Error + } else { + err = dbConn.Table("department_members").Where("department_id=?", departmentID).Find(&departmentMemberList).Error + } + if err != nil { return err, nil }