From 97303eebe4039057a6b430ad138863dc310a7211 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Mon, 18 Apr 2022 16:27:04 +0800 Subject: [PATCH] organization --- .../db/mysql_model/im_mysql_model/organization_model.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 0b7f1621e..76eb949a0 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 @@ -120,12 +120,12 @@ func UpdateUserInDepartment(departmentMember *db.DepartmentMember, args map[stri if err != nil { return err } - if err = dbConn.Table("department_members").Where("department_id=? ADN user_id=?", departmentMember.DepartmentID, departmentMember.UserID). + if err = dbConn.Table("department_members").Where("department_id=? AND user_id=?", departmentMember.DepartmentID, departmentMember.UserID). Updates(departmentMember).Error; err != nil { return err } if args != nil { - return dbConn.Table("department_members").Where("department_id=? ADN user_id=?", departmentMember.DepartmentID, departmentMember.UserID). + return dbConn.Table("department_members").Where("department_id=? AND user_id=?", departmentMember.DepartmentID, departmentMember.UserID). Updates(args).Error } return nil @@ -136,7 +136,7 @@ func DeleteUserInDepartment(departmentID, userID string) error { if err != nil { return err } - return dbConn.Table("department_members").Where("department_id=? ADN user_id=?", departmentID, userID).Delete(db.DepartmentMember{}).Error + return dbConn.Table("department_members").Where("department_id=? AND user_id=?", departmentID, userID).Delete(db.DepartmentMember{}).Error } func DeleteUserInAllDepartment(userID string) error {