From 9963d7d4a32900f82c1e27d1a8e9cdbba3672458 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 23 Jul 2024 17:07:17 +0800 Subject: [PATCH] update --- ...uper_cloud_issuance_user_robot_bind_follow_dao.go | 1 + ...super_cloud_issuance_user_robot_bind_follow_db.go | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/dao/super_cloud_issuance_user_robot_bind_follow_dao.go b/src/dao/super_cloud_issuance_user_robot_bind_follow_dao.go index 8d377c1..c46b3ba 100644 --- a/src/dao/super_cloud_issuance_user_robot_bind_follow_dao.go +++ b/src/dao/super_cloud_issuance_user_robot_bind_follow_dao.go @@ -7,6 +7,7 @@ import ( type SuperCloudIssuanceUserRobotBindFollowDao interface { GetCloudIssuanceUserRobotBindFollow(id int) (m *models.SuperCloudIssuanceUserRobotBindFollow, err error) + GetCloudIssuanceUserRobotBindFollowById(id int) (m *models.SuperCloudIssuanceUserRobotBindFollow, err error) GetCloudIssuanceUserRobotBindFollowByChatRoomId(chatRoomId string, robotId int) (m *models.SuperCloudIssuanceUserRobotBindFollow, err error) InsertCloudIssuanceUserRobotBindFollow(m *models.SuperCloudIssuanceUserRobotBindFollow) (id int, err error) SaveCloudIssuanceUserRobotBindFollow(id interface{}, m *models.SuperCloudIssuanceUserRobotBindFollow, forceColums ...string) (affected int64, err error) diff --git a/src/implement/super_cloud_issuance_user_robot_bind_follow_db.go b/src/implement/super_cloud_issuance_user_robot_bind_follow_db.go index 5929ad2..8afd9f9 100644 --- a/src/implement/super_cloud_issuance_user_robot_bind_follow_db.go +++ b/src/implement/super_cloud_issuance_user_robot_bind_follow_db.go @@ -65,6 +65,18 @@ func (s SuperCloudIssuanceUserRobotBindFollowDb) GetCloudIssuanceUserRobotBindFo return m, nil } +func (s SuperCloudIssuanceUserRobotBindFollowDb) GetCloudIssuanceUserRobotBindFollowById(id int) (m *models.SuperCloudIssuanceUserRobotBindFollow, err error) { + m = new(models.SuperCloudIssuanceUserRobotBindFollow) + has, err := s.Db.Where("id =?", id).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} + func (s SuperCloudIssuanceUserRobotBindFollowDb) GetCloudIssuanceUserRobotBindFollowByChatRoomId(chatRoomId string, robotId int) (m *models.SuperCloudIssuanceUserRobotBindFollow, err error) { m = new(models.SuperCloudIssuanceUserRobotBindFollow) has, err := s.Db.Where("chat_room_id =? AND robot_id = ? AND state = 1", chatRoomId, robotId).Get(m)