From d78f50990a83a44d511bd1ef549e2c9d80d5c9cf Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 6 Jul 2024 19:05:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E5=8F=91=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ance_user_robot_bind_source_follow_group_dao.go | 1 + ...uance_user_robot_bind_source_follow_group_db.go | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/dao/super_cloud_issuance_user_robot_bind_source_follow_group_dao.go b/src/dao/super_cloud_issuance_user_robot_bind_source_follow_group_dao.go index aad4ac6..eeedd72 100644 --- a/src/dao/super_cloud_issuance_user_robot_bind_source_follow_group_dao.go +++ b/src/dao/super_cloud_issuance_user_robot_bind_source_follow_group_dao.go @@ -6,4 +6,5 @@ import ( type SuperCloudIssuanceUserRobotBindSourceFollowGroupDao interface { BatchAddSuperCloudIssuanceUserRobotBindSourceFollowGroups(data []*models.SuperCloudIssuanceUserRobotBindSourceFollowGroup) (int64, error) + GetSuperCloudIssuanceUserRobotBindSourceFollowGroupsByChatRoomId(chatRoomId string) (m *models.SuperCloudIssuanceUserRobotBindSourceFollowGroup, err error) } diff --git a/src/implement/super_cloud_issuance_user_robot_bind_source_follow_group_db.go b/src/implement/super_cloud_issuance_user_robot_bind_source_follow_group_db.go index 6e2dafb..b5a7c22 100644 --- a/src/implement/super_cloud_issuance_user_robot_bind_source_follow_group_db.go +++ b/src/implement/super_cloud_issuance_user_robot_bind_source_follow_group_db.go @@ -1,8 +1,9 @@ -package implement +package implement import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" "xorm.io/xorm" ) @@ -22,3 +23,14 @@ func (s SuperCloudIssuanceUserRobotBindSourceFollowGroupDb) BatchAddSuperCloudIs } return affected, nil } +func (s SuperCloudIssuanceUserRobotBindSourceFollowGroupDb) GetSuperCloudIssuanceUserRobotBindSourceFollowGroupsByChatRoomId(chatRoomId string) (m *models.SuperCloudIssuanceUserRobotBindSourceFollowGroup, err error) { + m = new(models.SuperCloudIssuanceUserRobotBindSourceFollowGroup) + has, err := s.Db.Where("follow_chat_room_id =? ", chatRoomId).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +}